fork(5) download
  1. #include <algorithm>
  2. #include <functional>
  3. #include <iostream>
  4. #include <memory>
  5. #include <string>
  6. #include <type_traits>
  7. #include <utility>
  8.  
  9.  
  10. struct Stable
  11. {
  12. int i;
  13.  
  14. Stable(const Stable&) = delete;
  15. Stable(Stable&&) = delete;
  16.  
  17. Stable(int i) : i(i) {}
  18. };
  19.  
  20.  
  21.  
  22. Stable foo()
  23. {
  24. return {42};
  25. }
  26.  
  27.  
  28. int main()
  29. {
  30. std::cout << foo().i << std::endl;
  31. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
42