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] | |
On Feb 22, 2007, at 1:25 PM, Smith-Rowland, Edward M wrote:Actually, g++ happily accepts a mixture of things like "std::complex<float>" and "double _Complex" as the code attached to the first mail demonstrates. I will attempt to see if this compiles on Visual Studio 2005.
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).I really also would add a strong vote to mandate the complex layout - contiguous real complex - as standard.
-Howard
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |