]> gcc.gnu.org Git - gcc.git/commitdiff
allocator.h (std::allocator): Base class is __allocator_base.
authorBenjamin Kosnik <bkoz@redhat.com>
Mon, 19 Mar 2012 21:41:15 +0000 (21:41 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Mon, 19 Mar 2012 21:41:15 +0000 (21:41 +0000)
2012-03-19  Benjamin Kosnik  <bkoz@redhat.com>

* include/bits/allocator.h (std::allocator): Base class is
__allocator_base.
(uses_allocator): Add to sub-grouping.
* include/ext/new_allocator.h: Doxygen markup for tparm.

* config/allocator/bitmap_allocator_base.h: Use __allocator_base
template alias in C++11.
* config/allocator/malloc_allocator_base.h: Same.
* config/allocator/mt_allocator_base.h: Same.
* config/allocator/new_allocator_base.h: Same.
* config/allocator/pool_allocator_base.h: Same.

From-SVN: r185544

libstdc++-v3/ChangeLog
libstdc++-v3/config/allocator/bitmap_allocator_base.h
libstdc++-v3/config/allocator/malloc_allocator_base.h
libstdc++-v3/config/allocator/mt_allocator_base.h
libstdc++-v3/config/allocator/new_allocator_base.h
libstdc++-v3/config/allocator/pool_allocator_base.h
libstdc++-v3/include/bits/allocator.h
libstdc++-v3/include/ext/new_allocator.h

index a4ffc02b35a406c3a0067be23210a8693d02f55c..80e6de9b0d8feb211363dce6f3cfeb7ecd101fdf 100644 (file)
@@ -1,3 +1,17 @@
+2012-03-19  Benjamin Kosnik  <bkoz@redhat.com>
+
+       * include/bits/allocator.h (std::allocator): Base class is
+       __allocator_base.
+       (uses_allocator): Add to sub-grouping.
+       * include/ext/new_allocator.h: Doxygen markup for tparm.
+
+       * config/allocator/bitmap_allocator_base.h: Use __allocator_base
+       template alias in C++11.
+       * config/allocator/malloc_allocator_base.h: Same.
+       * config/allocator/mt_allocator_base.h: Same.
+       * config/allocator/new_allocator_base.h: Same.
+       * config/allocator/pool_allocator_base.h: Same.
+
 2012-03-19  Benjamin Kosnik  <bkoz@redhat.com>
 
        * include/ext/pb_ds/detail/pat_trie_/
index 3ae4cff6ccc9d54309ddeae29d95f0db0697fde4..4abe615274bd38f993cc40e80bada42ab9950f1d 100644 (file)
@@ -1,6 +1,6 @@
 // Base to std::allocator -*- C++ -*-
 
-// Copyright (C) 2004, 2005, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005, 2009, 2010, 2012 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
 #ifndef _GLIBCXX_CXX_ALLOCATOR_H
 #define _GLIBCXX_CXX_ALLOCATOR_H 1
 
-// Define bitmap_allocator as the base class to std::allocator.
 #include <ext/bitmap_allocator.h>
-#define __glibcxx_base_allocator  __gnu_cxx::bitmap_allocator
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+namespace std
+{
+  /**
+   *  @brief  An alias to the base class for std::allocator.
+   *  @ingroup allocators
+   *
+   *  Used to set the std::allocator base class to
+   *  __gnu_cxx::bitmap_allocator.
+   *
+   *  @tparam  _Tp  Type of allocated object.
+    */
+  template<typename _Tp>
+    using __allocator_base = __gnu_cxx::bitmap_allocator<_Tp>;
+}
+#else
+// Define bitmap_allocator as the base class to std::allocator.
+# define __allocator_base  __gnu_cxx::bitmap_allocator
+#endif
 
 #endif
index 1192b95596e9457f121aa40b18e89ef2a2598b4c..e40f424b60ba7e53dc7593df7e044c54d87f6ce7 100644 (file)
@@ -1,6 +1,6 @@
 // Base to std::allocator -*- C++ -*-
 
-// Copyright (C) 2004, 2005, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005, 2009, 2010, 2012 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
 #ifndef _GLIBCXX_CXX_ALLOCATOR_H
 #define _GLIBCXX_CXX_ALLOCATOR_H 1
 
-// Define new_allocator as the base class to std::allocator.
 #include <ext/malloc_allocator.h>
-#define __glibcxx_base_allocator  __gnu_cxx::malloc_allocator
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+namespace std
+{
+  /**
+   *  @brief  An alias to the base class for std::allocator.
+   *  @ingroup allocators
+   *
+   *  Used to set the std::allocator base class to
+   *  __gnu_cxx::malloc_allocator.
+   *
+   *  @tparam  _Tp  Type of allocated object.
+    */
+  template<typename _Tp>
+    using __allocator_base = __gnu_cxx::malloc_allocator<_Tp>;
+}
+#else
+// Define malloc_allocator as the base class to std::allocator.
+# define __allocator_base  __gnu_cxx::malloc_allocator
+#endif
 
 #endif
index 9cd8f8a6f0d05d0b30914f5e7340754dad6a6ffd..66ab6a0524505da5a7f630d7640e71c2d5241d08 100644 (file)
@@ -1,6 +1,6 @@
 // Base to std::allocator -*- C++ -*-
 
-// Copyright (C) 2004, 2005, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005, 2009, 2010, 2012 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
 #ifndef _GLIBCXX_CXX_ALLOCATOR_H
 #define _GLIBCXX_CXX_ALLOCATOR_H 1
 
-// Define mt_allocator as the base class to std::allocator.
 #include <ext/mt_allocator.h>
-#define __glibcxx_base_allocator  __gnu_cxx::__mt_alloc
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+namespace std
+{
+  /**
+   *  @brief  An alias to the base class for std::allocator.
+   *  @ingroup allocators
+   *
+   *  Used to set the std::allocator base class to
+   *  __gnu_cxx::__mt_alloc.
+   *
+   *  @tparam  _Tp  Type of allocated object.
+    */
+  template<typename _Tp>
+    using __allocator_base = __gnu_cxx::__mt_alloc<_Tp>;
+}
+#else
+// Define __mt_alloc as the base class to std::allocator.
+# define __allocator_base  __gnu_cxx::__mt_alloc
+#endif
 
 #endif
index 6f8aef360a684eb3625626f84a27548af08ade9b..7a0b71becafd309caa4c388f13cd04947b7b961e 100644 (file)
@@ -1,6 +1,6 @@
 // Base to std::allocator -*- C++ -*-
 
-// Copyright (C) 2004, 2005, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005, 2009, 2010, 2012 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
 #ifndef _GLIBCXX_CXX_ALLOCATOR_H
 #define _GLIBCXX_CXX_ALLOCATOR_H 1
 
-// Define new_allocator as the base class to std::allocator.
 #include <ext/new_allocator.h>
-#define __glibcxx_base_allocator  __gnu_cxx::new_allocator
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+namespace std
+{
+  /**
+   *  @brief  An alias to the base class for std::allocator.
+   *  @ingroup allocators
+   *
+   *  Used to set the std::allocator base class to
+   *  __gnu_cxx::new_allocator.
+   *
+   *  @tparam  _Tp  Type of allocated object.
+    */
+  template<typename _Tp>
+    using __allocator_base = __gnu_cxx::new_allocator<_Tp>;
+}
+#else
+// Define new_allocator as the base class to std::allocator.
+# define __allocator_base  __gnu_cxx::new_allocator
+#endif
 
 #endif
index 55aec79bcdfb2fe783be5d5d42c57bff94bc9be8..2fc49e2eccb8a9c180f80056dda8d1e72f95f30a 100644 (file)
@@ -1,6 +1,6 @@
 // Base to std::allocator -*- C++ -*-
 
-// Copyright (C) 2004, 2005, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005, 2009, 2010, 2012 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
 #ifndef _GLIBCXX_CXX_ALLOCATOR_H
 #define _GLIBCXX_CXX_ALLOCATOR_H 1
 
-// Define new_allocator as the base class to std::allocator.
 #include <ext/pool_allocator.h>
-#define __glibcxx_base_allocator  __gnu_cxx::__pool_alloc
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+namespace std
+{
+  /**
+   *  @brief  An alias to the base class for std::allocator.
+   *  @ingroup allocators
+   *
+   *  Used to set the std::allocator base class to
+   *  __gnu_cxx::__pool_alloc.
+   *
+   *  @tparam  _Tp  Type of allocated object.
+    */
+  template<typename _Tp>
+    using __allocator_base = __gnu_cxx::__pool_alloc<_Tp>;
+}
+#else
+// Define __pool_alloc as the base class to std::allocator.
+# define __allocator_base  __gnu_cxx::__pool_alloc
+#endif
 
 #endif
index b985d3f5e6fe1b71d3caa697bf420c7b3fe5c7ab..49ba0b5be4fbaf16a3083c964d4b182992a5652c 100644 (file)
@@ -1,7 +1,7 @@
 // Allocators -*- C++ -*-
 
 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-// 2011 Free Software Foundation, Inc.
+// 2011, 2012 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -84,9 +84,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    *
    *  See http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt04ch11.html
    *  for further details.
+   *
+   *  @tparam  _Tp  Type of allocated object.
    */
   template<typename _Tp>
-    class allocator: public __glibcxx_base_allocator<_Tp>
+    class allocator: public __allocator_base<_Tp>
     {
    public:
       typedef size_t     size_type;
@@ -104,7 +106,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       allocator() throw() { }
 
       allocator(const allocator& __a) throw()
-      : __glibcxx_base_allocator<_Tp>(__a) { }
+      : __allocator_base<_Tp>(__a) { }
 
       template<typename _Tp1>
         allocator(const allocator<_Tp1>&) throw() { }
@@ -134,6 +136,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     operator!=(const allocator<_Tp>&, const allocator<_Tp>&)
     { return false; }
 
+  /// Declare uses_allocator so it can be specialized in <queue> etc.
+  template<typename, typename>
+    struct uses_allocator;
+
   /**
    * @}
    */
@@ -146,7 +152,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 #endif
 
   // Undefine.
-#undef __glibcxx_base_allocator
+#undef __allocator_base
 
   // To implement Option 3 of DR 431.
   template<typename _Alloc, bool = __is_empty(_Alloc)>
@@ -206,10 +212,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
          { return false; }
       }
     };
-
-  // Declare uses_allocator so it can be specialized in <queue> etc.
-  template<typename, typename>
-    struct uses_allocator;
 #endif
 
 _GLIBCXX_END_NAMESPACE_VERSION
index 0c82bd0ae900f1d5bc859ae30660a8b3f7e7b0e0..1e4069df922281ea5d265384424fc08d49b1ff12 100644 (file)
@@ -49,6 +49,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    *  This is precisely the allocator defined in the C++ Standard. 
    *    - all allocation calls operator new
    *    - all deallocation calls operator delete
+   *
+   *  @tparam  _Tp  Type of allocated object.
    */
   template<typename _Tp>
     class new_allocator
This page took 0.074713 seconds and 5 git commands to generate.