fork download
  1. #include <iostream>
  2. #include <utility>
  3. using std::cout;
  4.  
  5. int foo (int const& lippman) { cout << "1\n"; }
  6. int foo (int && lippman) { cout << "2\n"; }
  7.  
  8. int main() {
  9. int i = 42;
  10. foo(i);
  11. foo(42);
  12. foo(std::move(i));
  13. return 0;
  14. }
Success #stdin #stdout 0s 3344KB
stdin
Standard input is empty
stdout
1
2
2