fork(1) download
  1. #include <iostream>
  2.  
  3. using std::cerr;
  4.  
  5. class A
  6. {
  7. public:
  8. A() { cerr << "A::A()\n"; }
  9. A(const A &) { cerr << "A::A(const A&)\n"; }
  10. A(A &&) { cerr << "A::A(A&&)\n"; }
  11. A(const A &&) = delete;
  12. A& operator = (const A &) { cerr << "A::operator=(const A&)\n"; return *this; }
  13. A& operator = (A &&) { cerr << "A::operator(A&&)\n"; return *this; }
  14. A& operator = (const A &&) = delete;
  15. ~A() { cerr << "A::~A()\n"; }
  16.  
  17. const A get() const { cerr << "const A A::get() const\n"; return A(); }
  18. A get() { cerr << "A A::get()\n"; return A(); }
  19. };
  20.  
  21. int main()
  22. {
  23. A a;
  24. A b = a.get();
  25. }
Success #stdin #stdout #stderr 0s 3408KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
A::A()
A A::get()
A::A()
A::~A()
A::~A()