Can I call constructor of a member in my Class's constructor?
let say If I have a member bar
of class type foo
in my class MClass
. Can I call constructor of bar in MClass's constructor? If not, then how can I initialize my member bar?
It is a problem of initializing members in composition(aggregation).
See Question&Answers more detail:os