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-12 6:47

>>6

Flexible != close-to-the-silicon.  And C++ is close to the silicon.  So no, you can't treat types as first-class entities and pass them as parameters like you would anything else to a method.

Of course, you can pass types as template parms.  What are you trying to do in f()?

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