fork(1) download
  1. #include <iostream>
  2.  
  3. struct MyClass
  4. {
  5. void Foo(int x)& { std::cout << "Foo(int)&.\n"; }
  6. void Foo(int x)&& { std::cout << "Foo(int)&&.\n"; }
  7. };
  8.  
  9. int main() {
  10. MyClass m;
  11. m.Foo(3);
  12. MyClass{}.Foo(3);
  13. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
Foo(int)&.
Foo(int)&&.