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: C99 _Complex and C++ complex<> interoperability.


On Feb 22, 2007, at 1:25 PM, Smith-Rowland, Edward M wrote:

My questions are:
 Is this behavior standard or is this a gcc extension?
 If this is a gcc extension where is it documented?

Also, if this behavior is nonstandard is anyone thinking about
standardizing it?
Finally, the circle would be complete if we could assign from
std::complex to _Complex.
Any ideas?  There is a private functions that return _Complex from
std::complex.

Fwiw here are some relevant links:


http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#387

The above link is a C++ committee library working group defect report on this subject. It is in an open state meaning that no decision has been made.

Below is a link to a paper which further discusses (really just summarizes) the issue:

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1589.html

In a nutshell, there is support on the C++ committee for making the C+ + and C99 complex types layout compatible. I'm not aware of support for making them API compatible. Currently C++ will not parse the syntax for C99 complex types and I know of know proposal to do so. However if the complex types were layout compatible one could link C99 and C++ sources and have them refer to the very same complex data structures, even passing them back and forth (just referenced with different syntax in the different translation units).

-Howard


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