This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Incompatible type of std::imag function
- From: Paolo Carlini <pcarlini at suse dot de>
- To: Gene Novark <gnovark at cs dot umass dot edu>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Wed, 01 Feb 2006 10:30:35 +0100
- Subject: Re: Incompatible type of std::imag function
- References: <43E05841.8010905@cs.umass.edu>
Gene Novark wrote:
> Any thoughts?
Sure. To tell you the truth, I really noticed the issue only recently,
when implementing part of tr1/complex and learned that there is an open DR:
http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#387
and a paper:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1589.html
Upon a quick check, it looks like knowledgeable people agree that this
is a real defect and that the solution adopted in v3 is better than the
letter of the current standard, at least (*).
As a very general observation - probably you are already aware of this -
even if we wanted to change such functions (real, imag), we couldn't do
that without breaking the binary compatibility, because only the return
type would be different.
Paolo.
(*) Note, however, that now that TR1 is out, setters seem slightly
better from the point of view of consisteny with TR1, 8.1.9: the
additional overloads cannot return by reference.