This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: Problems with PR 21210


Mark Mitchell wrote:
> Gabriel Dos Reis wrote:
> 
>> Mark Mitchell <mark@codesourcery.com> writes:
> 
> 
>>   template<class T>
>>    inline complex<T>    make_std_complex(T __complex__ z)
>>    {
>>       return complex<T>(__real__ z, __imag__ z);
>>    }
>>
>> has zero abstraction penalty. 
>> I'm very reluctant to additions of constructors.
> 
> 
> That's OK with me -- if you're willing to accept the fact that this will
> silently change the meaning of:
> 
>   __complex__ double c99_cd;
>   complex<double> cpp_cd(c99_cd);
> 
> I just want to make sure that you're aware that what you're suggesting
> will change that; it will now simply copy the real part, and ignore the
> imaginary part.
> 

I suspect I won't be the only person to say this, but if this change is
made it should be documented VERY, VERY CLEARLY. I have personally
worked on code where both __complex__ double and complex<double> and the
exact above notation was moved to convert one to the other, and I'm sure
I'm not the only person (in particular because it was believed, I
believe not entirely without reason, that __complex__ was move efficent).

Chris


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