fork download
  1. #include <iostream>
  2.  
  3. int main() {
  4. int i = 0;
  5.  
  6. // lvalue
  7. int &i_ref1 = ++i;
  8.  
  9. // rvalue - error
  10. //int &i_ref2 = i++;
  11.  
  12. return 0;
  13. }
Success #stdin #stdout 0s 2848KB
stdin
Standard input is empty
stdout
Standard output is empty