The typeid and dynamic_cast operators can be used in constructors or destructors, or in functions called from a constructor or a destructor.
If the operand of dynamic_cast used refers to an object under construction or destruction, typeid returns the type_info representing the class of the constructor or destructor.
If the operand of dynamic_cast refers to an object under construction or destruction, the object is considered to be a complete object that has the type of the constructor's or destructor's class.
The result of the typeid and dynamic_cast operations is undefined if the operand refers to an object under construction or destruction, and if the static type of the operand is not an object of the constructor's or destructor's class or one of its bases.
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.