initialize members in object-lifetime.cpp
This commit is contained in:
parent
292143e700
commit
e270dda904
1 changed files with 4 additions and 1 deletions
|
@ -14,7 +14,10 @@ struct C {
|
||||||
A a;
|
A a;
|
||||||
B b;
|
B b;
|
||||||
|
|
||||||
C() { puts("C()"); }
|
C()
|
||||||
|
: a(), b() {
|
||||||
|
puts("C()");
|
||||||
|
}
|
||||||
~C() { puts("~C()"); }
|
~C() { puts("~C()"); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue