fork download
  1. #include <iostream>
  2. #include <iomanip>
  3.  
  4. using namespace std;
  5.  
  6. struct Test
  7. {
  8. Test& operator = (const Test& t) { cout << "Test =\n"; return *this; }
  9. };
  10.  
  11.  
  12. class Object
  13. {
  14. public:
  15. Object& operator=(const Object& object) = default;
  16. private:
  17. int i;
  18. Test t;
  19. };
  20.  
  21. int main(int argc, char * argv[])
  22. {
  23. Object a, b;
  24. a = b;
  25. a = a;
  26. }
  27.  
Success #stdin #stdout 0s 4820KB
stdin
Standard input is empty
stdout
Test =
Test =