20
In C++, how can I check if the type of an object is inherited from a specific class?
class Form { };
class Moveable : public Form { };
class Animatable : public Form { };
class Character : public Moveable, public Animatable { };
Character John;
if(John is moveable)
// ...
In my implementation the if query is executed over all elements of a Form list. All objects which type is inherited from Moveable can move and need processing for that which other objects don't need.