1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include <iostream> class foo { int x; public: foo( int x ):x(x) {} private: foo(foo const&); }; int main() { foo obj = 10; }
1 2 3
In function 'int main()': Line 11: error: 'foo::foo(const foo&)' is private compilation terminated due to -Wfatal-errors.