fork download
  1. #include <iostream>
  2.  
  3. class Foo {
  4. public:
  5. Foo(int, int) {}
  6. ~Foo() {std::cout << "Foo\n"; }
  7. };
  8.  
  9. Foo rbv();
  10.  
  11. int main()
  12. {
  13. Foo x = rbv(); // the return-value of rbv() goes into x
  14. }
  15.  
  16. Foo rbv()
  17. {
  18. return Foo(42, 73); // suppose Foo has a ctor Foo::Foo(int a, int b)
  19. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
Foo