prog.cpp: In function 'int main()':
prog.cpp:13:7: error: use of deleted function 'hasY::hasY()'
hasY hy;
^
prog.cpp:8:5: note: 'hasY::hasY()' is implicitly deleted because the default definition would be ill-formed:
hasY() = default;
^
prog.cpp:8:5: error: no matching function for call to 'Y::Y()'
prog.cpp:4:5: note: candidate: Y::Y(const Y&)
Y(const Y&) {}
^
prog.cpp:4:5: note: candidate expects 1 argument, 0 provided