Does C ++ have the correct implementation of an interface that does not use vtable?
eg
class BaseInterface{ public: virtual void func() const = 0; } class BaseInterfaceImpl:public BaseInterface{ public: void func(){ std::cout<<"called."<<endl; } } BaseInterface* obj = new BaseInterfaceImpl(); obj->func();
the func call in the last line goes to vtable to find func ptr from BaseInterfaceImpl :: func, but is there any C ++ way to do this directly since BaseInterfaceImpl is not subclassed from any class other than the pure BaseInterface interface class?
Thanks. Gil.
c ++ interface vtable
gilbertc
source share