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-13 4:45

>>15
The main reason why I want to do this, is for learning, actually. Because, in the past I have tried many times in many ways to obtain the true type of a virtual object, similar to what Java has provided. And I am out of luck. With the only possible hint of light being to learn how typeid() is implemented.

>>7
As for the Lisp thing (and any future language posted),
I love C++, hence I plan to do this in C++.
Lisp is ok, but I hate their prefix syntax.

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