Complex numbers in c++0x

Gabriel Dos Reis dosreis@gmail.com
Thu Jun 11 08:10:00 GMT 2009


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



More information about the Gcc mailing list