Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C++ typeid()

Name: Anonymous 2006-01-11 12:59

Does anyone know how typeid() is implemented in C++???
I mean, how do I make a function like typeid() where I can pass the TYPE as a paramter.

Example:
int main()
{
    typeid(int);//<-- works of course
    f(int);//<-- how to do something like this
           //        without using macros or templates
}

Name: Anonymous 2006-01-16 4:29

>>22
Lower level languages have less features like that. You can't expect to know implementation details at run time.

So you don't do that. If you need to, think again. If you *really* *really* *pretty really* need to, user a higher level language and be prepared for a performance loss which you usually can afford. I discourage Java, it sucks. Try Python.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List