fork(2) download
  1. #include <iostream>
  2.  
  3. struct Yoba
  4. {
  5. Yoba(int a_) : a(a_) { }
  6. int a;
  7. };
  8.  
  9. Yoba yoba_factory(int a)
  10. {
  11. return std::move(Yoba(a));
  12. }
  13.  
  14. int main() {
  15.  
  16. Yoba maliyoba = yoba_factory(5);
  17.  
  18. std::cout << "a = " << maliyoba.a;
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
a = 5