10 Nov
2005
10 Nov
'05
4:50 p.m.
Dear Jens, On Thu, 10 Nov 2005, Jens Vollinga wrote:
if we added two static constants to every class like
class SOMECLASS { public: const static char* tinfo_name; const static unsigned tinfo; // ... rest of class ... } const char* SOMECLASS::tinfo_name = "SOMECLASS"; const unsigned SOMECLASS::tinfo = (unsigned)SOMECLASS::idstring;
On second thought, is it not a problem that these members are non-virtual in the sense that SOMECLASS x; basic*bp = &x; cout << bp->tinfo_name << endl; is always going to print "basic"? Best, Chris