Because you don't have any virtual functions in the base class, you are just out of luck. Otherwise you could get the typeid of the actual class using: typeid *this
Anyway, your function should be virtual in the base class and overridden in the child classes. Please remember: inheritance models an is-a relationship, so restricting service for specific child-classes goes against it's intended use. Better have the restricted behavior for the base class, and allow more in some child classes.