What is a “RTTI”?
Moderator:Moderators
Hello, I am an BE student and i have passed the exam of CPP subject that is my favorite and always try to learn new. I got a new word RTTI in a book but still didn't clear exactly what is? So Can you?
Re: What is a “RTTI”?
Sorry, doesn't ring a bell. But fortunately, I use the internet a bit more carefully!
Behold:
http://en.wikipedia.org/wiki/RTTI
Behold:
http://en.wikipedia.org/wiki/RTTI
Re: What is a “RTTI”?
Run Time Type Identification. It is extra metadata put into each class definiton which contains the name of that class in the source code (amongst other things).
Personally, I dont find it too useful. It is designed for a base class to be able to interigate a pointer it has, and work out which subclass that pointer is.
However, that defeats the purpose of having a base class in the first place, meaning the code is probably not being written in a sensible fashon.
It does however aid debugging with the object itself storing its name, rather than the debugger having to keep track of the extra metadata in the symbol table.
~Andrew
Personally, I dont find it too useful. It is designed for a base class to be able to interigate a pointer it has, and work out which subclass that pointer is.
However, that defeats the purpose of having a base class in the first place, meaning the code is probably not being written in a sensible fashon.
It does however aid debugging with the object itself storing its name, rather than the debugger having to keep track of the extra metadata in the symbol table.
~Andrew
![Image](http://www.danasoft.com/sig/andrewcooper.jpg)