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: Problems with PR 21210


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.

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


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