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

I'm really not a compiler expert, but is this optimization common in C++ for example? I thought all virtual methods incurred the cost of a vtable lookup


Just slapping the virtual keyword on some function doesn't do anything. Overrides may or may not happen via vtable. Often compilers can figure out how to dispatch at compile time and don't need the vtable.




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

Search: