The constructors for virtual base classes are always called from the most derived class, using any arguments it might pass in. In your case, the most derived class doesn’t specify an initializer for A
, so the default constructor is used.
More Related Contents:
- I am trying to develop a Complex number calculator. [closed]
- C++ What’s the standard way to define a recursive constructor?
- What does the explicit keyword mean?
- What is this weird colon-member (” : “) syntax in the constructor?
- In C++, what is a virtual base class?
- Can I call a constructor from another constructor (do constructor chaining) in C++?
- What is a converting constructor in C++ ? What is it for?
- Do built-in types have default constructors?
- Conversion constructor vs. conversion operator: precedence
- C++: constructor initializer for arrays
- What is the default constructor for C++ pointer?
- Scope of variables in if statements
- Who deletes the memory allocated during a “new” operation which has exception in constructor?
- call to pure virtual function from base class constructor
- How can i use member initialization list to initialize an array?
- Destructors of builtin types (int, char etc..)
- Do I really need to implement user-provided constructor for const objects?
- avoiding the tedium of optional parameters
- Can class template constructors have a redundant template parameter list in c++20
- Will an ’empty’ constructor or destructor do the same thing as the generated one?
- Object layout in case of virtual functions and multiple inheritance
- How to add constructors/destructors to an unnamed class?
- Struct Constructor in C++?
- Virtual tables and memory layout in multiple virtual inheritance
- Initializing a union with a non-trivial constructor
- Constructor initialization Vs assignment
- C++11 anonymous union with non-trivial members
- No matching function for call to Class Constructor
- What is the VTT for a class?
- When virtual inheritance IS a good design?