[GiNaC-devel] tinfo

Jens Vollinga vollinga at physik.uni-wuppertal.de
Thu Nov 10 17:09:23 CET 2005


Dear Chris,

maybe I am obsessed ... but what about the following variant (I had this 
version first but then decided to put a more *polished* version on the 
list...):

class SOMECLASS
{
public:
	const static char* tinfo_name;
	const static unsigned tinfo;
	virtual const unsigned int id()
	{
		return (unsigned int)SOMECLASS::tinfo_name;
	}
};
const char* SOMECLASS::tinfo_name = "SOMECLASS";
const unsigned SOMECLASS::tinfo = (unsigned)SOMECLASS::tinfo_name;

Well, the unsigned tinfo variable is maybe not necessary. And if tinfo() 
in every ginac class would return char* no casting would be necessary 
from the start.

Regards,
Jens


More information about the GiNaC-devel mailing list