News for hackers. Stuff that matters.
Re:C++ Frequently Questioned Answers by calambrac on Monday May 11, 2009 @05:57PM (#604416)
Dude, RTTI only works for classes with virtual functions or their derivatives.
Re:C++ Frequently Questioned Answers by timr on Monday May 11, 2009 @06:26PM (#604464)
Yes, I know. You're arguing that not all classes have vtables. I'm arguing that there's no reason that they can't, save for efficiency concerns. And if you're so concerned about efficiency that vtables are a burden, then you're already in a situation where an interpreted language is inappropriate for your needs.
Re:C++ Frequently Questioned Answers by calambrac on Monday May 11, 2009 @06:42PM (#604484)
Now you're arguing something different. Just because all classes can, doesn't mean that they do, or that a general purpose tool (like, say, a garbage collector) can assume that they do. It's not a question of efficiency, it's a question of what the language allows. If you're saying "everything has to have a vtable", then you aren't talking about C++.