This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Complex numbers in c++0x
- From: Gabriel Dos Reis <dosreis at gmail dot com>
- To: Marc Steinbach <steinbach at ifam dot uni-hannover dot de>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 11 Jun 2009 03:10:40 -0500
- Subject: Re: Complex numbers in c++0x
- References: <4A30B1EB.7050307@ifam.uni-hannover.de>
- Reply-to: gdr at integrable-solutions dot net
On Thu, Jun 11, 2009 at 2:27 AM, Marc
Steinbach<steinbach@ifam.uni-hannover.de> wrote:
> In <tr1_impl/complex>, GCC defines an additional overload of conj(x)
> for non-complex arithmetic types, as specified in 26.3.9 [cmplx.over]
> of the upcoming C++ Standard (Working Draft).
> The Draft mandates certain type promotion of x.
>
> In the (experimental) GCC implementation, conj(x) returns x as a
> complex value (with imaginary part zero).
>
> I strongly suggest to return x as a non-complex type
> (specifically, the required promoted argument type).
>
> As I read the Draft, this should satisfy the requirement of an
> /effectively/ promoted argument: if needed, the returned real
> will transparently be converted to complex.
> (Actually I find a real return type so essential that it should be
> /mandated/ by the standard. Is such a change still possible?)
The best place to address this issue is to take it to the C++ standards
committee or post your message to the Usenet group
comp.std.c++
-- Gaby