So, the ordinary way to call a parent class' constructor is in the initialization list:
e.g.
#include <cstdio>
struct Parent {
explicit Parent(int a) {
printf("Parent -- int\n");
}
};
struct Child : public Parent {
explicit Child(int a) : Parent(1) {
printf("Child -- int\n");
}
};
int main(int argc, char **argv) {
Child c = Child(10);
};
prints Parent -- int
then Child -- int
.
(Somewhat) disregarding whether it's a good idea or not, I'm wondering whether it's possible to call the parent constructor explicitly in the body of the constructor (on the object being constructed), outside the initialization list.