1 Jun 2005 05:09
Re: Problems with PR 21210
Mark Mitchell <mark <at> codesourcery.com>
2005-06-01 03:09:37 GMT
2005-06-01 03:09:37 GMT
Nathan (Jasper) Myers wrote: > On Tue, May 31, 2005 at 03:20:29PM -0700, Mark Mitchell wrote: > >>I'm not sure what other areas of concern arise, with respect to this PR, >>which is just about the core language. >> >>There are indeed other questions, though, like: >> >>1. Overload resolution >> >> void f(std::complex<double>); >> void f(__complex__ double); >> >>2. Should we have overloads of "sin" (and so forth) for "__complex__" >> types? > > > The Intent of the Committee was that compilers would open-code complex > and val_array objects if there was anything to be gained by it. > That is, std::complex<> and __complex__ ought to one and the same > type. I hope the C committee has not given them such different > semantics that it's impossible. (From now on, I'm going to call __complex__ by its official C99 name, which is _Complex.) Every libstdc++ std::complex<> presently contains a _Complex, so making them the same type would break that. But, yes, it would be cool if they were magically the same type.(Continue reading)
> This also depends on somebody not myself doing a not-insubstantial
> amount of core compiler work to make it happen; and somebody else
> jimmying the libstdc++ headers to match, presumably a lesser task.
I agree that this could be made to work, by essentially hard-wiring
std::complex/_Complex into the compiler, rather than defining it in the
library.
That would be a considerably more radical change, though; historically,
G++ has indeed treated the types as separate.
RSS Feed