class Base
{
public:
virtual void func1()
{
std::cout<<"Base func1"<<std::endl;
}
//virtual destructor
};
class Derived : public Base
{
public:
virtual void func1()
{
std::cout<<"Derived Base func1"<<std::endl;
}
virtual void func2()
{
std::cout<<"Derived func2"<<std::endl;
}
};
int main()
{
Derived *d = new Derived;
delete d;
}
I want to know if there will be two "vptr"s created for resolving virtual functions, one in the Base class which will be inherited in Derived class object for func1 and other one in the Derived object for func2.
Derived.Derivedand we suppose it's Stdndard-compliant, then the Standard cannot require 2 vptrs.