------- 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" <[EMAIL PROTECTED]> 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

Reply via email to