foo.cc: In function 'int main()':
foo.cc:8:23: error: cannot bind rvalue reference of type 'int&&' to lvalue of type 'int'
8 | for (int &&i: g) cin >> i, --i;
| ^
foo.cc:8:20: warning: loop variable 'i' of type 'int&&' binds to a temporary constructed from type 'int' [-Wrange-loop-construct]
8 | for (int &&i: g) cin >> i, --i;
| ^
foo.cc:8:20: note: use non-reference type 'int' to make the copy explicit or 'const int&' to prevent copying
foo.cc:9:23: error: cannot bind rvalue reference of type 'int&&' to lvalue of type 'int'
9 | for (int &&i: c) cin >> i;
| ^
foo.cc:9:20: warning: loop variable 'i' of type 'int&&' binds to a temporary constructed from type 'int' [-Wrange-loop-construct]
9 | for (int &&i: c) cin >> i;
| ^
foo.cc:9:20: note: use non-reference type 'int' to make the copy explicit or 'const int&' to prevent copying
[Hydro](https://hydro.ac)提供评测服务