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 <mark@codesourcery.com> writes:

| 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.

Yes, I understand that (as you explained in the previous message).
This is a tricky area, especially with all the conversions.  I note
also that the various iterations of the proposal to increase
compatibility between C99 and C++ are mostly silent, except suggesting
that *if* an implementation supports C99 complex then it is encouraged
to make them compatible.  What exactly that means is a bit unclear.  I
tried to clear up that stuff in 2002 and everybody agreed, and while I
was not watching it suddenly came back.  Please allow me a day or two,
to recape with other suggestions going on.

-- Gaby


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