Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Dude, RTTI only works for classes with virtual functions or their derivatives.


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.


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++.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: