Problems with PR 21210

Mark Mitchell mark@codesourcery.com
Mon May 30 22:59:00 GMT 2005


Jason Merrill wrote:
> On Sun, 29 May 2005 13:06:46 -0700, Mark Mitchell <mark@codesourcery.com> 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 13.3.3.2/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?

-- 
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304



More information about the Libstdc++ mailing list