4 ms·
Dude, RTTI only works for classes with virtual functions or their derivatives.
by calambrac 17y ago
Dude, RTTI only works for classes with virtual functions or their derivatives.
- timr 17y agoYes, 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.
- calambrac 17y agoNow 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++.