struct notcopyable { public: notcopyable() {} private: notcopyable(const notcopyable& other) {} }; class A : notcopyable { }; int main() { A a; A b(a); }
Standard input is empty
prog.cpp:8:7: error: base class 'notcopyable' has private copy constructor
class A : notcopyable
^
prog.cpp:6:2: note: declared private here
notcopyable(const notcopyable& other) {}
^
prog.cpp:15:4: note: implicit copy constructor for 'A' first required here
A b(a);
^
1 error generated.
Standard output is empty