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 8:03

Hi. Thanks for all your constructive comments.
Esspecially >>21
It may be noted that I actually learned C++ first before JAVA or any language for that matter.
Its just that, ever since I learned C++, I've been trying to figure out how to get something like a TYPE-pointer or something, where I can get the true-type of a virtual-object, which typeid() does not provide. And I gave up, until I learnt JAVA and saw that they managed to do what I wanted for so long. So that's why I'm posting this thread here.
I'm SURE there must be a way.
I mean, C++ is a lower-level language compared to JAVA, right?

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