[Patch] libstdc++/31426 & C++0x type_traits

Paolo Carlini pcarlini@suse.de
Wed May 30 20:14:00 GMT 2007


Benjamin Kosnik wrote:

>> the below tries to implement rather literally Doug's suggestion for 
>> solving the coexistence problem of TR1 and C++0x headers, as 
>> discussed back in April. As part of it, <type_traits> is now a bit 
>> closer to the C++0x specifications, uses more front-end builtins, but 
>> more work is needed, here and elsewhere, just as a small example, 
>> is_signed / is_unsigned are different in C++0x. But all of that 
>> should be manageable in that framework, because, as the type_traits 
>> example shows, Doug's idea easily allow code reuse from tr1_impl.
>
> Cool.

Thanks.

By the way, if you are willing to implement the C++0x behavior for 
is_signed / is_unsigned, just let me know. I'm asking specifically 
asking that because apparently will imply some small tweaks to 
make_signed / make_unsigned (your baby ;) : if you have a plain char 
type, which happens to be signed on a given platform (i.e., type(-1) < 
type(0)), the current implementation of make_signed "returns" the type 
as-is, doesn't produce signed char, and a test fails (together with my 
draft implementation of the C++0x is_signed).

> This looks good to me, modulo
>
> _GLIBCXX_TR1_NAMESPACE_BEGIN
> shoud be
> _GLIBCXX_BEGIN_NAMESPACE_TR1
>
> and similar for NAMESPACE_END.

Will do the change, thanks.

> I tested it against the behavior previously specified in:
> http://gcc.gnu.org/ml/libstdc++/2007-04/msg00177.html
>
> Seems like everything we want to work passes: nice! I think it would 
> be a good idea to add some kind of sanity test along these lines, but 
> where/when I don't know.

Agreed. Together with the above changes, I have also some small changes 
to complex and a typo fixed for cwchar. My plan therefore is committing 
that, and then start working on additional tests, and further tweaks.

Paolo.



More information about the Libstdc++ mailing list