fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. class Foo
  6. {
  7. public:
  8. void bar() &
  9. {
  10. cout << "L" << endl;
  11. }
  12.  
  13. void bar() &&
  14. {
  15. cout << "R" << endl;
  16. }
  17. };
  18.  
  19. int main()
  20. {
  21. Foo f;
  22. f.bar();
  23. std::move(f).bar();
  24.  
  25. return 0;
  26. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
L
R