#include <iostream> class X{public: X(int q) {} ~X() { std::cout << "~X()" << std::endl; }private: X(const X&); { std::cout << "copy ctor" << std::endl; }}; int main(){ X x = 1;}
Standard input is empty
prog.cpp:14: error: expected unqualified-id before '{' token prog.cpp: In function 'int main()': prog.cpp:13: error: 'X::X(const X&)' is private prog.cpp:21: error: within this context
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!