fork download
  1. #include <cstdio>
  2. #include <utility>
  3. using namespace std;
  4.  
  5. class A{
  6. public:
  7. A(){ printf("A CTOR\n");}
  8. A(const A&) {printf("A CTOR by copy\n");}
  9. A(A&&){ printf("A CTOR by universal reverence\n");}
  10. A& operator=(const A& ) = delete;
  11. };
  12.  
  13. A create(){
  14. return A();
  15. }
  16.  
  17. int main() {
  18. A x{ create() };
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0s 2928KB
stdin
Standard input is empty
stdout
A CTOR