fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3. class A
  4. {
  5. public:
  6. A(){}
  7. A(A&&) = default;
  8. int i;
  9.  
  10. private:
  11. A(const A&);
  12. A& operator=(const A&);
  13. };
  14.  
  15. int main() {
  16. const A a = []() {
  17. A a;
  18. a.i = 10;
  19. return a;
  20. }();
  21. cout << a.i;
  22. return 0;
  23. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
10