This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/49022] [C++0x][DR 2058] std::begin and std::end specialized for std::valarray with some operators are missing.


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

--- Comment #24 from Gabriel Dos Reis <gdr at gcc dot gnu.org> 2011-06-14 13:54:13 UTC ---
(In reply to comment #18)

> It should be identical to
> 
> auto&& range = v1 + v2;
> for (auto b = std::begin(range), e = std::end(range); b != e; ++b)
>   { ... }
> (see 6.5.4 [stmt.ranged])

This will not work with expression template-based implementation
of valarray.  The reason is that `range' may be a surrogate, and
you are likely to get rubbish addresses.

I urge people to drop range-based iteration on valarrays.
It wasn't something we were dieing for.  It grew out of
someone's idea of "uniformity" that failed to appreciate
that a valarray is not your usual container.

- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]