Boost logo

Boost :

Subject: Re: [boost] Determining interest: Pure imaginary number library
From: Neal Becker (ndbecker2_at_[hidden])
Date: 2011-11-18 10:51:12


Vicente Botet wrote:

...
>
> Some comments related to the interface. I will replace
>
> T& imag();
> const T& imag() const;
>
> by
>
> T imag() const;
>
> As there is no reason to provide non-const access to the internal
> representation.
>

I disagree - there is a use to provide non-const access. Unless it happens that
the internal representation is not obvious.

Removing non-const real() and imag() was done in std::complex, and I think that
was a mistake. It makes some uses really annoying (requiring hacks). The
reason for this, as I understand, is so a different internal rep could be used.
And you know what? Who does that?!? I seriously doubt any implementation is
not simply:

flt m_real;
flt m_imag;

Sure, you could interally use polar notation - but noone does.


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