, enum , RTTI.
I thought the other day that in these classic OOP problems, you can also use a class variant, say:
variant<Tiger, Cat, Frog, Dog> object;
These classes can be inherited, say, from Animal, virtual functions are not needed at all in the implementation, but it will be necessary to check the type whose instance is contained variantat run time.
source
share