#include <iostream> #include <utility> struct S { S() = default; S(const S&) = default; S(S&&) = delete; }; int main() { S s1; S s2 = s1; S s3 = std::move(s1); }
Standard input is empty
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;
^
Standard output is empty