Some questions regarding c++ inheritance:
In what order is the code of baseconstructors executed?
Is there a way to influence this order? (for example, other languages allow to place “super()” somewhere within the constructor)
Is it ok to access protected members of base classes in the constructor?
Suppose that class A has i base classes B_i, all of the B_i constructors are executed before any of the code for A’s constructor is executed. The only exception is when you initialise a base class with a non-default constructor, but once they are run then all base classes are executed, and they have to go first in the initialiser list anyway. It is fine to access protected members of base classes because the base class is already constructed.
For example:
If your member
memberOfAneeds something from B calledmemberOfBthen that’s fine because B is already constructed.