fork download
  1. template<typename T>
  2. void f(const T&& param); // “&&” means rvalue reference
  3.  
  4. int main()
  5. {
  6. int x = 10;
  7. f(x);
  8. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:7:5: error: cannot bind 'int' lvalue to 'const int&&'
  f(x);
     ^
prog.cpp:2:6: note:   initializing argument 1 of 'void f(const T&&) [with T = int]'
 void f(const T&& param);               // “&&” means rvalue reference
      ^
stdout
Standard output is empty