#include <iostream>using namespace std; class Product{public: Product(const char *name, int i); Product(Product &&rhs) = delete; Product(const Product &rhs) = delete; ~Product();private: const char *m_name; int m_i;}; int main() { auto p = Product{"abc",123}; return 0;}
Standard input is empty
prog.cpp: In function 'int main()': prog.cpp:17:28: error: use of deleted function 'Product::Product(Product&&)' auto p = Product{"abc",123}; ^ prog.cpp:8:2: note: declared here Product(Product &&rhs) = delete; ^
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!