fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void f (int &&a)
  5. {
  6. a = 1;
  7. //do somethins;
  8. }
  9.  
  10. int main() {
  11. int b = 1;
  12. int &&bb = 2;
  13. int &a = b;
  14.  
  15. cout << &a;
  16.  
  17. f(bb);
  18.  
  19. return 0;
  20. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:17:7: error: cannot bind ‘int’ lvalue to ‘int&&’
     f(bb);
       ^~
prog.cpp:4:6: note:   initializing argument 1 of ‘void f(int&&)’
 void f (int &&a)
      ^
stdout
Standard output is empty