E
er
hi,
what if i have
class B{public: virtual void f()const=0;};
class D0: public B{/*empty */};
class D1: public B{/*empty */};
is the execution of f slower for
class A: public D0{public: virtual void f()const;}
than it is for
class A: public B{public: virtual void f()const;}
given that their implementations for f are the same?
i'm aware that
http://www.parashift.com/c++-faq-lite/virtual-functions.html says:
"The compiler creates a v-table for each class that has at least one
virtual function."
but the reason i have a doubt is that D0 and D1 are used only to
specify two abstract sub-hierarchies.
what if i have
class B{public: virtual void f()const=0;};
class D0: public B{/*empty */};
class D1: public B{/*empty */};
is the execution of f slower for
class A: public D0{public: virtual void f()const;}
than it is for
class A: public B{public: virtual void f()const;}
given that their implementations for f are the same?
i'm aware that
http://www.parashift.com/c++-faq-lite/virtual-functions.html says:
"The compiler creates a v-table for each class that has at least one
virtual function."
but the reason i have a doubt is that D0 and D1 are used only to
specify two abstract sub-hierarchies.