C99 _Complex and C++ complex<> interoperability.

Benjamin Kosnik bkoz@redhat.com
Fri Mar 16 12:22:00 GMT 2007


> | I have noticed that it is possible (since 4.0) to construct and assign
> | from a C99 complex number to a C++ complex number.
> | 
> | I think this is very cool.  This goes part way towards reconciling C99
> | and C++ as far as complex numbers are concerned.
> | 
> | I don't see this in the C++ standard or under g++ extensions in the
> | manual.
> 
> It is not in the ISO C++ standard.  It is purely a libstdc++
> implementation detail.  However, I've taken deliberately chosen to
> make  ISO C++ std::complex<> and ISO C _Complex interoperate where
> possible.  It is therefore a GCC extension that I'm not willing to
> formally document at this moment because there are other issues that
> are resolved yet and that might change in the future.

FWIW, I too think this is cool and where the standard should be headed.

If somebody was to write up the current libstdc++ behavior as 
standardese or a paper, (likely that would also mean attending a meeting 
or two and trying to get it discussed), and if Red Hat is a voting 
member of ISO C++, I would vote yes.

-benjamin




More information about the Libstdc++ mailing list