> virtual function are a lot slower than the direct C equivalent.
How would you do in C then? Because however it is, it can be done that way in C++.
More seriously though, you are saying that C++ does something like:
this->v_btl->virtual_call(params); right?
I would agree, but how would you do this any faster in C? Recognize that you may not cast the
object pointer to a derived class, the compiler can't (necessarily) know that the conversion
is valid, and you could cast it in C++ if the programmer happens to know more than the
compiler.
i.e. if you were to do:
derived_virtual_impl(klass, params) in C, you could do:
obj->Derived::impl(params) in C++ and call the appropriate implementation directly.
Is there some neat-o technique I'm missing?