fork download
  1. class Y
  2. {
  3. public:
  4. Y(const Y&) {}
  5. };
  6.  
  7. struct hasY {
  8. hasY() = default;
  9. hasY(hasY&&) = default;
  10. Y mem;
  11. };
  12. int main() {
  13. hasY hy;
  14. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
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
stdout
Standard output is empty