
20 Oct
2009
20 Oct
'09
11:43 a.m.
Hi, Here is my idea for this little class: class rtti_base { virtual void _dummy() {} }; Every class deriving from rtti_base can be queried by means of RTTI, in particular rtti_base class and dynamic_cast can be used in similar way as IUnknown and QueryInterface() in COM Object Model rtti_base* could be used as a "smart" void* pointer - we can get type information, and use it in heterogenic containers as in: std::list<rtti_base*> beings; we can iterate through beings and call Cat::GiveMilk() for cats but Girl::Kiss() for girls. :-) The main purpose of this class is to set some standard name for that pointer type. Ireneusz Szpilewski