Hi, if anybody has a second, I have a quick question:
In the following situation, Container can contain any combination of the derived classes. If I wanted to go through "Container", for example, and delete all instances of the class DerivedC, how would I do that?
class Base; class DerivedA : public Base; class DerivedB : public Base; class DerivedC : public Base; ... std::vector<Base*> Container;
The only idea I have come up with is to add an "int type" variable to "Base" that gets set in the constructor of each derived class, so that I know which is which. Isn't there a more elegant way of doing something like this though?
Thanks for any help.