Take the tour ×  Curious if anyone has any ideas on this one;
working on a game engine that implements a tree of GameObject's.
Various specific game objects inherit from that type (
BouncingBall, StatScreen, or whatever).  class GameObject {
vector<Component *> Components;     vector<GameObject *>
Children;     GameObject *Parent;  So at runtime, the game will
have a huge tree of these, all of different types. Unfortunately
the objects in the Children vectors are all reported as
"GameObject *" in the debugger making it really hard to tell
what's what.  Best solution I've come up with is to store the
type as a member variable on construction:  class GameObject {
// ...     const char *Type;      // Saves current class name as
Type.     template<class T>     void StoreTypeName( T
*thisPointer ) {         this->Type = typeid( *thisPointer
).name();  But then in every object constructor I have to
remember to call StoreTypeName:  class FancyBlinkingObject :
public GameObject {     FancyBlinkingObject() {