This is the mail archive of the
mailing list for the GCC project.
Re: Problems with PR 21210
Jason Merrill wrote:
On Sun, 29 May 2005 13:06:46 -0700, Mark Mitchell <firstname.lastname@example.org> wrote:
So, we get an overload ambiguity; converting to double is no better
than converting to __complex__ double.
Sounds to me like the solution is to change that. Make converting to
__complex T worse than converting to T, by a new rule in 22.214.171.124/4.
I'm not very keen on that solution, in that it means adding complexity
to an already complex taxonomy of conversions. But, it could certainly
be done, and I can see an argument for saying that it's intuitively a
simpler conversion. I could definitely go along.
(I'm surprised by Gaby's proposal in that I'm very surprised that the
library people would consider silently changing the behavior of
constructing a "std::complex<double>" from a "__complex__ double" to be
anything other than the obvious copy. But, if the library people are
happy, it's OK with me.)
My original suggestion to add constructors to std::complex requires no
changes to the language and is backwards-compatible with ISO C++, as far
as I can tell; what's wrong with that?