Boost logo

Boost :

Subject: Re: [boost] [complex] Feedback and Potential Review Manager
From: Neal Becker (ndbecker2_at_[hidden])
Date: 2012-05-07 11:02:54


Christopher Kormanyos wrote:

>
>
>> Did you also notice in my other post that
>> my suggested correction was, in fact, wrong? I am terribly
>> sorry about that. You actually need this:
>> explicit
> complex(const T& re = T(), const T& im = T());
>
> Geez! How many times can I get it wrong? I'm making
> a fool of myself here.
>
> It's non-explicit and the default params are not zero,
> but rather the default ctor of the template type.
>
> complex(const T& re = T(), const T& im = T());
>
> It's time for me to take a break...
>
> Best regards, Chris.
>

Do I understand correctly that the default contructor does not set real and imag
parts to zero? Hurray!!

I consider it a serious defect in std::complex that it's default constructor
performs non-trivial work. Often large arrays of complex need to be constructed
in high-performance computing applications.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk