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]

[libstdc++-v3] C++0x PATCH: Use _GLIBCXX_TR1 instead of tr1


This patch uses _GLIBCXX_TR1 instead of tr1 in several libstdc++-v3
headers, making them work properly in C++0x mode.

Tested and committed to cxx0x-branch, where it is needed to get
libstdc++ to compile.

I do not suggest this patch for mainline, because we are working on a
better solution for C++0x and TR1 headers that will make this patch
unnecessary.

- Doug

2007-04-26 Douglas Gregor <doug.gregor@gmail.com>

	* libstdc++-v3/include/ext/pb_ds/detail/type_utils.hpp: Replace
	"tr1" with _GLIBCXX_TR1.
	* libstdc++-v3/include/ext/throw_allocator.h: Ditto.
	* libstdc++-v3/include/ext/array_allocator.h: Ditto.
	* libstdc++-v3/testsuite/util/testsuite_allocator.h: Ditto.
	* libstdc++-v3/testsuite/util/rng/twister_rand_gen.hpp: Ditto.

Index: include/ext/pb_ds/detail/type_utils.hpp
===================================================================
--- include/ext/pb_ds/detail/type_utils.hpp	(revision 124185)
+++ include/ext/pb_ds/detail/type_utils.hpp	(working copy)
@@ -58,23 +58,23 @@ namespace pb_ds
{
  namespace detail
  {
-    using std::tr1::is_same;
-    using std::tr1::is_const;
-    using std::tr1::is_pointer;
-    using std::tr1::is_reference;
-    using std::tr1::is_fundamental;
-    using std::tr1::is_member_object_pointer;
-    using std::tr1::is_member_pointer;
-    using std::tr1::is_base_of;
-    using std::tr1::remove_const;
-    using std::tr1::remove_reference;
+    using std::_GLIBCXX_TR1::is_same;
+    using std::_GLIBCXX_TR1::is_const;
+    using std::_GLIBCXX_TR1::is_pointer;
+    using std::_GLIBCXX_TR1::is_reference;
+    using std::_GLIBCXX_TR1::is_fundamental;
+    using std::_GLIBCXX_TR1::is_member_object_pointer;
+    using std::_GLIBCXX_TR1::is_member_pointer;
+    using std::_GLIBCXX_TR1::is_base_of;
+    using std::_GLIBCXX_TR1::remove_const;
+    using std::_GLIBCXX_TR1::remove_reference;

    // Need integral_const<bool, true> <-> integral_const<int, 1>, so
    // because of this use the following typedefs instead of importing
    // std::tr1's.
-    using std::tr1::integral_constant;
-    typedef std::tr1::integral_constant<int, 1> true_type;
-    typedef std::tr1::integral_constant<int, 0> false_type;
+    using std::_GLIBCXX_TR1::integral_constant;
+    typedef std::_GLIBCXX_TR1::integral_constant<int, 1> true_type;
+    typedef std::_GLIBCXX_TR1::integral_constant<int, 0> false_type;

    using __gnu_cxx::__conditional_type;
    using __gnu_cxx::__numeric_traits;
Index: include/ext/throw_allocator.h
===================================================================
--- include/ext/throw_allocator.h	(revision 124185)
+++ include/ext/throw_allocator.h	(working copy)
@@ -78,7 +78,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
    get_prob();

  private:
-    std::tr1::mt19937 _M_generator;
+    std::_GLIBCXX_TR1::mt19937 _M_generator;
  };


Index: include/ext/array_allocator.h =================================================================== --- include/ext/array_allocator.h (revision 124185) +++ include/ext/array_allocator.h (working copy) @@ -87,7 +87,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) * @brief An allocator that uses previously allocated memory. * This memory can be externally, globally, or otherwise allocated. */ - template<typename _Tp, typename _Array = std::tr1::array<_Tp, 1> > + template<typename _Tp, typename _Array = std::_GLIBCXX_TR1::array<_Tp, 1> > class array_allocator : public array_allocator_base<_Tp> { public: Index: testsuite/util/testsuite_allocator.h =================================================================== --- testsuite/util/testsuite_allocator.h (revision 124185) +++ testsuite/util/testsuite_allocator.h (working copy) @@ -247,7 +247,7 @@ namespace __gnu_test // (see N1599). struct uneq_allocator_base { - typedef std::tr1::unordered_map<void*, int> map_type; + typedef std::_GLIBCXX_TR1::unordered_map<void*, int> map_type;

    // Avoid static initialization troubles and/or bad interactions
    // with tests linking testsuite_allocator.o and playing globally
Index: testsuite/util/rng/twister_rand_gen.hpp
===================================================================
--- testsuite/util/rng/twister_rand_gen.hpp	(revision 124185)
+++ testsuite/util/rng/twister_rand_gen.hpp	(working copy)
@@ -75,7 +75,7 @@ namespace pb_ds
      get_prob();

    private:
-      typedef std::tr1::mt19937 base_generator_t;
+      typedef std::_GLIBCXX_TR1::mt19937 base_generator_t;

    private:
      base_generator_t m_base_generator;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]