This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/49022] [C++0x] std::begin and std::end specialized for std::valarray with some operators are missing.
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 17 May 2011 15:53:00 +0000
- Subject: [Bug libstdc++/49022] [C++0x] std::begin and std::end specialized for std::valarray with some operators are missing.
- Auto-submitted: auto-generated
- References: <bug-49022-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49022
--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-05-17 15:27:01 UTC ---
The workaround for users is to construct a valarray from the expr:
std::valarray<int> result(x + y);
std::begin( result );
That avoids the problem of returning an iterator into a temporary which no
longer exists.