Consider the Waldo class, which inherits from Foo and Baz, namely:
class Waldo : public Foo, public Baz {
...
};
When I create a new instance of Waldo:
Waldo *w = new Waldo;
Are the Foo and Baz constructors called? If they are not called by default, is there an easy way in the CLASS DECLARATION OR in the Waldo constructor DECLARATION / DEFINITION to get them called?
(It looks like I'm trying to make a chain of constructors, but C ++ supposedly does not. I'm not sure.)
What I'm trying to do is “annotate” various class declarations in which annotations lead (among other things) instances of the annotated class to links to lists supported by annotation classes. This allows me, for example, to view a list of all objects using Baz-nature, apply a certain operation to them and not worry about whether I remember to add an instance to the list of objects with Baz-nature, since the constructor did this automatically.
source
share