fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void MyFunction(int & value)
  6. {
  7. cout << "Lvalue reference" << endl;
  8. }
  9.  
  10. void MyFunction(int && value)
  11. {
  12. cout << "Rvalue reference" << endl;
  13. }
  14.  
  15. int main()
  16. {
  17. MyFunction(3);
  18. return 0;
  19. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
Rvalue reference