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 11:53:29 -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 #5 from crazydm at gmail dot com 2008-09-03 11:53 -------
(In reply to comment #4)
> This is not a bug, see 26.3.1/3: "Any function returning a valarray<T> is
> permitted to return an object of another type, provided all the const member
> functions of valarray<T> are also applicabel to this type". CC-ing Gaby, to be
> sure.
>
Well, but it is not applicabel to helper class slice_array. May be this bug is
not in vallaray, but in slice_array, that must have copy constructor whith a
such type. I do not know, but I think that operator[](slice) const can be used
to create slice_arrays, because it is designated for a such task.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37347