What is the VTT for a class?

The page “Notes on Multiple Inheritance in GCC C++ Compiler v4.0.1” is offline now, and http://web.archive.org didn’t archive it. So, I have found a copy of the text at tinydrblog which is archived at the web archive. There is full text of the original Notes, published online as part of “Doctoral Programming Language Seminar: GCC … Read more

Why is Default constructor called in virtual inheritance?

When using virtual inheritance, the virtual base class’s constructor is called directly by the most derived class’s constructor. In this case, the daughter constructor directly calls the grandmother constructor. Since you didn’t explicitly call grandmother constructor in the initialization list, the default constructor will be called. To call the correct constructor, change it to: daugther(int … Read more

c++ virtual inheritance

virtual base classes are special in that they are initialized by the most derived class and not by any intermediate base classes that inherits from the virtual base. Which of the potential multiple initializers would the correct choice for initializing the one base? If the most derived class being constructed does not list it in … Read more

In C++, what is a virtual base class?

Virtual base classes, used in virtual inheritance, is a way of preventing multiple “instances” of a given class appearing in an inheritance hierarchy when using multiple inheritance. Consider the following scenario: class A { public: void Foo() {} }; class B : public A {}; class C : public A {}; class D : public … Read more