fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void f(int & lvalue)
  5. {
  6.  
  7. }
  8.  
  9. void f(int && rvalue)
  10. {
  11. rvalue = 0;
  12. }
  13.  
  14. int main() {
  15. int arr[3] = { 1, 2, 3 };
  16. int i;
  17.  
  18. i = 0;
  19. for(auto && v : arr)
  20. {
  21. f(std::move(v));
  22. cout << v;
  23. }
  24.  
  25. return 0;
  26. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
000