fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class MyType {
  5. public:
  6. MyType() {
  7. cout << "Default ctor" << endl;
  8. }
  9.  
  10. MyType(const MyType& other) {
  11. cout << "Copy ctor" << endl;
  12. }
  13.  
  14. MyType& operator=(const MyType& other) {
  15. cout << "Assignment op" << endl;
  16. return *this;
  17. }
  18. };
  19.  
  20. int main() {
  21. MyType a, b;
  22. b = a;
  23. return 0;
  24. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
Default ctor!
Default ctor!
Assignment op