#include <iostream>using namespace std; class Test{public: Test() { cout << "default\n"; } private: Test(const Test&) { cout << "copy\n"; } Test& operator = (const Test&) { cout << "assign\n"; return *this; }}; int main() { Test t = Test();}
Standard input is empty
prog.cpp: In function ‘int main()’: prog.cpp:13:2: error: ‘Test::Test(const Test&)’ is private Test(const Test&) ^ prog.cpp:26:16: error: within this context Test t = Test(); ^
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!