#include <iostream> struct Test{ Test(Test const &) = delete; Test(Test &&) = delete; Test &operator=(Test const &) = delete; Test &operator=(Test &&) = delete; Test(int &x) { ++x; }}; int main(){ int x = 6; Test t = x; std::cout << x << std::endl;}
Standard input is empty
prog.cpp: In function ‘int main()’: prog.cpp:19:11: error: use of deleted function ‘Test::Test(Test&&)’ Test t = x; ^ prog.cpp:6:2: error: declared here Test(Test &&) = delete; ^
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!