3 ms·
Hm, I'm super concerned about performance! I know, I'll turn every function call into a virtual function call!
by kevingadd 15y ago
Hm, I'm super concerned about performance! I know, I'll turn every function call into a virtual function call!
- ComputerGuru 15y agoDon't be silly, the principle is sound. #ifdef _DEBUG typedef BasicLinkedList LinkedList #else typedef XorLinkedList LinkedList #endif
- aggftw 15y agoExcept this is not about performance, but memory.
- hythloday 15y agoYou'd implement it either with a policy-based class[0] or a CRTP compile-time virtual dispatch[1]. There's zero need to involve vtables in this. [0] http://en.wikipedia.org/wiki/Policy-based_design [1] http://en.wikipedia.org/wiki/Curiously_recurring_template_pattern#Static_polymorphism