This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Incompatible type of std::imag function


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]