
18 Nov
2011
18 Nov
'11
4:56 p.m.
Le 18/11/11 16:51, Neal Becker a écrit :
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.
What this non-const conversion allows? imaginary i; i.imag() = 3.0; Do you really think that i = imag(3.0); is less efficient or clear? Am I missing something? Best, Vicente