Hacker News new | ask | show | jobs
by Buge 3985 days 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.
1 comments

There 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/n385...

[2] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n399...