RTTI on a pure abstract class.
Posted on 1998-12-22
Is it possible to obtain RTTI information for a pure abstract base class?
I have a class that calls a "debug check" procedure. For one or two of the checks in the procedure it calls a virtual function that is pure in the base class. This is not ussually a problem, except if the check procedure is called from the constructor or destructor (or procedures they call). In that case, this causes an exception as the virtual function is not implimented. I would like to automatically skip this check during construction and destruction.
To detect if the class is being constructed or destructed, I could get the class's RTTI information in the check procedure. The question is, does that work? Does C++ return information for a pure abstract base class? Is that information different than the information for the fully constructed class? I want to know what the standard prescribes, not what a particular compiler does.