[GiNaC-devel] tinfo

Chris Dams Chris.Dams at mi.infn.it
Thu Nov 10 16:50:50 CET 2005


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



More information about the GiNaC-devel mailing list