[v3] c++0x includes

Benjamin Kosnik bkoz@redhat.com
Wed Feb 21 16:35:00 GMT 2007


> Just as a clarification (or complication ;-)) the TR1 complex.h will 
> most likely be a little different than the C++0X complex.h.  The TR1 
> complex.h has:
> 
> 
>> and provides sufficient using declarations to declare in the
>> global namespace all function and type names declared or defined in the 
>> neader <complex>.
> 
> However:
> 
> http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#551
> 
> is currently set to remove that clause.  I glanced through the patch and 
> I believe you have the C++0X definition of complex.h (which is what I 
> recommend).

Cool.

> I also glanced at tgmath.h.  I could be mistaken but it doesn't look 
> right to me in the patch.  It should be:
> 
> #include <complex.h> // or <ccomplex>
> #include <math.h>
> 
> It currently looks like it includes <cmath> instead of <math.h>.

OK.

Yes, there are some issues remaining, but this seems a general approach 
will get us all the way there with minimum difficulty.

For sure, the "C" interface needs more work. (And may need work on every 
specific unix.) I'm likely to give this a go on linux (corrected 
__BEGIN_NAMESPACE_STD in glibc's sys/cdefs.h, etc.), and maybe solaris 
11 and newlib.

I suspect a better way to package this work is to just not touch the 
default "C" includes and instead clone a new model, ie

--enable-cheaders=c++0x

which will do this part.

That way I can check a version of this in and it can be worked on 
incrementally...

-benjamin



More information about the Libstdc++ mailing list