This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/37347] valarray::operator[](slice) const returns wrong type.
- From: "crazydm at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Sep 2008 12:25:07 -0000
- Subject: [Bug libstdc++/37347] valarray::operator[](slice) const returns wrong type.
- References: <bug-37347-16660@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #8 from crazydm at gmail dot com 2008-09-03 12:25 -------
(In reply to comment #7)
> Also note: in your original message you have wrong the relevant bit:
>
> > valarray::operator[](slice) const returns _Expr<_SClos<_ValArray,_Tp>, _Tp>
> > instead of slice_array<Tp>,
> ^^^^^^^^^^^^^^^
>
> The return type, to which 26.3.1/3 applies, is valarray<T>, *not*
> slice_array<T>.
>
Thanks a lot, it seems that my documentation is rather old. And I was also
decepted with non const operator, that returns slice_array<T>, not valarray<T>.
P.S. With valarray<T> everything works fine.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37347