fork(2) download
  1. class b
  2. {
  3. public :
  4. b(){}
  5. virtual ~b(){}
  6.  
  7. private:
  8. b(const b&);
  9. };
  10.  
  11. class d : public b
  12. {
  13. public:
  14. d():b(){}
  15. ~d(){}
  16. };
  17.  
  18. int main()
  19. {
  20. d obj1;
  21. d obj2( obj1 );
  22. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In copy constructor ‘d::d(const d&)’:
prog.cpp:8: error: ‘b::b(const b&)’ is private
prog.cpp:12: error: within this context
prog.cpp: In function ‘int main()’:
prog.cpp:21: note: synthesized method ‘d::d(const d&)’ first required here 
stdout
Standard output is empty