Hello everyone,
I've got an interesting situation. There are three classes [named "A", "B" and "C"], all derived from a abstract base class [named "base"]. However, in my program, I need to sort a vector of "base" object in a way such that objects of type A are less than B, which are less than C.
In order to achieve this, I need to add pure virtual function to the base class like "bool isA(), bool isB()" etc, which in the derived class would return the appropriate value.
However, this appear to me as a bit messy and perhaps I am doing something against the OOP philosophy, since if I would add a derived class D, I'd have to modify every class!
How would you handle this situation?
--
E