This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/28414] return type of valarray's sqrt function isn't valarray
- From: "gdr at integrable-solutions dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Jul 2006 23:57:42 -0000
- Subject: [Bug libstdc++/28414] return type of valarray's sqrt function isn't valarray
- References: <bug-28414-12972@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from gdr at integrable-solutions dot net 2006-07-17 23:57 -------
Subject: Re: New: return type of valarray's sqrt function isn't valarray
"djg at cray dot com" <gcc-bugzilla@gcc.gnu.org> writes:
| The return type of valarray's sqrt function isn't valarray, as specified in
| 26.3.3.3 [lib.valarray.transcend], and what it does return doesn't convert to
| valarray in some cases. This causes the slice1.cpp example from the Josuttis
| book examples to get a compile error:
|
| http://www.josuttis.com/libbook/num/slice1.cpp.html
This is not a bug. The implementation is conformant to the C++
standard, which says, 16.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 applicable to this type. This return type shall
not add more than two levels of template nesting over the most
deeply nested argument type.
Please read further the book by Josuttis for a note about this.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28414