3 ms·
I'm trying to run the c++ version, but it won't compile because the loop variables in the range for loops do not have declarations.
by Buge 11y ago
I'm trying to run the c++ version, but it won't compile because the loop variables in the range for loops do not have declarations.
- detrino 11y agoThere was a proposal[1][2] for C++17 to allow: for (e : c) which would be equivalent to: for (auto &&e : c) Gcc implements this when compiling with -std=c++1z. My understanding is that it was rejected by the committee. [1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3853.htm http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n385... [2] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3994.htm http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n399...