fork download
  1. class noncopyable
  2. {
  3. protected:
  4. noncopyable() {};
  5. ~noncopyable() {};
  6. private:
  7. noncopyable (const noncopyable&);
  8. const noncopyable& operator= (const noncopyable&);
  9. };
  10.  
  11. class Root
  12. {
  13. };
  14.  
  15. class Fixture
  16. :
  17. public noncopyable
  18. {
  19. public:
  20. Fixture (Root& root)
  21. :
  22. mRoot (root)
  23. {
  24. }
  25. private:
  26. Root& mRoot;
  27. };
  28.  
  29. class Branch
  30. :
  31. public Root,
  32. public Fixture
  33. {
  34. public:
  35. Branch()
  36. :
  37. Fixture (*this)
  38. {
  39. }
  40. };
  41.  
  42. int main()
  43. {
  44. Branch branch;
  45. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In constructor ‘Branch::Branch()’:
prog.cpp:37:23: error: call of overloaded ‘Fixture(Branch&)’ is ambiguous
prog.cpp:37:23: note: candidates are:
prog.cpp:20:5: note: Fixture::Fixture(Root&)
prog.cpp:15:7: note: Fixture::Fixture(const Fixture&)
stdout
Standard output is empty