#include using std::cout; struct A { A() = default; A(int x) { val = x; } void print() { cout << "A(" << val << ")"; } int val; }; struct B { // B(int x) { a = A(x); } B(int x) : a(x) {} void print() { cout << "B("; a.print(); cout << ")"; } A a; }; int main() { B b(10); b.print(); cout << "\n"; }