fork(5) download
  1. #include <iostream>
  2.  
  3. namespace Test {
  4. using namespace std;
  5.  
  6. class A {
  7. public:
  8. virtual ~A() {
  9. cout << "~A()" << endl;
  10. }
  11.  
  12. A() {
  13. cout << "A()\n";
  14. }
  15.  
  16. A(A const& other) {
  17. cout << "A(A const&)\n";
  18. }
  19.  
  20. A(A&& other) {
  21. cout << "A(A&&)\n";
  22. }
  23.  
  24. A(A const&& other) {
  25. cout << "A(A const&&)\n";
  26. }
  27.  
  28. A& operator=(A const& other) {
  29. cout << "operator=(A const&)\n";
  30. return *this;
  31. }
  32.  
  33. A& operator=(A&& other) {
  34. cout << "operator=(A&&)\n";
  35. return *this;
  36. }
  37.  
  38. A& operator=(A const&& other) {
  39. cout << "operator=(A const&&)\n";
  40. return *this;
  41. }
  42.  
  43. A const& operator=(A const& other) const {
  44. cout << "operator=(A const&) const\n";
  45. return *this;
  46. }
  47.  
  48. A const& operator=(A&& other) const {
  49. cout << "operator=(A&&) const\n";
  50. return *this;
  51. }
  52.  
  53. A const& operator=(A const&& other) const {
  54. cout << "operator=(A const&&) const\n";
  55. return *this;
  56. }
  57. A operator+(A const& other) const {
  58. cout << "operator+(A const&) const\n";
  59. return A();
  60. }
  61. };
  62. } // Test
  63.  
  64. int main() {
  65. using namespace Test;
  66. return 0;
  67. }
  68.  
Success #stdin #stdout 0s 3136KB
stdin
Standard input is empty
stdout
Standard output is empty