[Bug c++/59165] gcc looks up begin(), end() for for-range loops for ints in namespace std

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Nov 18 10:46:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59165

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to thakis from comment #0)
> This compiles, but shouldn't:

You add declarations to namespace std which is undefined behaviour, so any
result is valid.

The DR looks wrong to me, the point of treating std as an associated namespace
is that std::begin and std::end will be found for user-defined containers, not
just the standard containers.  I don't know why core decided to change that.



More information about the Gcc-bugs mailing list