fork download
  1. #include <iostream>
  2. #include <utility>
  3.  
  4. struct S
  5. {
  6. S() = default;
  7. S(const S&) = default;
  8. S(S&&) = delete;
  9. };
  10.  
  11. int main()
  12. {
  13. S s1;
  14. S s2 = s1;
  15. S s3 = std::move(s1);
  16. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:15:24: error: use of deleted function ‘S::S(S&&)’
     S s3 = std::move(s1);
                        ^
prog.cpp:8:5: note: declared here
     S(S&&) = delete;
     ^
stdout
Standard output is empty