c++0x vs. tr1 type_traits, round 1
Benjamin Kosnik
bkoz@redhat.com
Thu Apr 26 15:15:00 GMT 2007
> Therefore I would ask you to go ahead with something straighforward, as
> we discussed above: set-up a separate implementation of type_traits for
> C++0x by copying the current TR1 one, adjusting the names of those 4
> traits discussed between yesterday and today, adding the new traits.
Yeah, well.... this doesn't work.
:(
Attached is the seemingly straightforward patch. There are a lot of
failures... mainly because large parts of TR1 include tr1/type_traits.
ie:
<bkoz@montsouris> /mnt/share/src/gcc/libstdc++-v3/include/tr1
%grep type_traits * | grep include
common.h:#include <tr1/type_traits>
functional:#include <tr1/type_traits>
functional:#include <ext/type_traits.h>
hashtable:#include <tr1/type_traits> // For true_type and false_type
hashtable_policy.h:#include <ext/type_traits.h>
memory:#include <tr1/type_traits> // tr1::add_reference
random:#include <tr1/type_traits>
random:#include <ext/type_traits.h>
type_traits:#include <tr1/type_traitsfwd.h>
<bkoz@montsouris> /mnt/share/src/gcc/libstdc++-v3/include/std
%grep type_traits * | grep include
complex:#include <bits/cpp_type_traits.h>
streambuf:#include <bits/cpp_type_traits.h>
streambuf:#include <ext/type_traits.h>
string:#include <bits/cpp_type_traits.h>
type_traits:/** @file include/type_traits
type_traits:#include <bits/type_traitsfwd.h>
If we go this way, to get things to work we'll have to:
1) add an abstraction header so that we know "which" type_traits to
include, ie:
#ifdef __GXX_EXPERIMENTAL_CXX0X__
# include <type_traits>
#else
# include <tr1/type_traits>
#endif
2) fixups for namespace issues, probably fully qualifying all uses
3) potential fixups for name change issues
Thus, this seems less and less straightforward.
This is striking me more and more as the wrong path. Maybe
_GLIBCXX_SUPPRESS_TR1 is the way to go after all...
Hmmm...
-benjamin
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: p.20070426-2
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20070426/b531b5b0/attachment.ksh>
More information about the Libstdc++
mailing list