This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: c++0x vs. tr1 type_traits, round 1
- From: Paolo Carlini <pcarlini at suse dot de>
- To: Benjamin Kosnik <bkoz at redhat dot com>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Thu, 26 Apr 2007 01:04:44 +0200
- Subject: Re: c++0x vs. tr1 type_traits, round 1
- References: <462FD7DF.6090208@redhat.com>
Hi,
a couple of quick observations...
+ template<typename _Tp>
+ struct has_trivial_default
+ : public integral_constant<bool, is_pod<_Tp>::value> { };
+
+ template<typename _Tp>
+ struct has_nothrow_default
+ : public integral_constant<bool, is_pod<_Tp>::value> { };
the final names for those facilities are:
has_trivial_default_constructor
has_nothrow_default_constructor
has_trivial_copy_constructor
has_nothrow_copy_constructor
(I'm going to change all of them to exploit the front-end traits,
already available).
In general, these issue about TR1 vs C++0x are nasty. Other traits, for
example, are undergoing subtle semantic changes (for example, I
implemented __is_base_of consistently with the C++0x semantics and, as
you can see, for now, for TR1, I'm adjusting it a bit to the TR1
semantics); likewise for is_convertible_to, which will be different in
C+++0x (I'm currently working on the front-end support for it).
I wish we manage to find a decently clean solution, which could also
mean separate files...
Paolo.