http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59165
Daniel Krügler <daniel.kruegler at googlemail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |daniel.kruegler@googlemail. | |com --- Comment #4 from Daniel Krügler <daniel.kruegler at googlemail dot com> --- (In reply to Jonathan Wakely from comment #3) > I think I remember the rationale now: std::begin and std::end only work if > c.begin() and c.end() xist, in which case range-based for will use those > members directly anyway. This is not really the *reason* for the language change. The actual reason becomes a bit clearer when looking at the dup of CWG 1442: http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#1445 I remember that this dup was actually inspired by the observation that BOOST_FOR_EACH behaved subtly different to the language for-each lookup rules, albeit both constructs are intended to perform the same thing. CWG 1442 just ensured that the lookup rule in for each corresponds to existing lookup rules in other places and is thus easier to understand.