My C++ framework has Buttons. A Button derives from Control. So a function accepting a Control can take a Button as its argument. So far so good.
I also have List<
T>. However, List<
Button> doesn't derive from List<
Control>, which means a function accepting a list of Controls can't take a list of Buttons as its argument. This is unfortunate.
Maybe this is a stupid question, but I don't see how can I solve this :( List<
Button>
should derive from List<
Control>
, but I don't see a way to make this happen "automatically".