+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_/
// 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
// 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
// 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
// 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
// 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
// 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
*
* 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;
allocator() throw() { }
allocator(const allocator& __a) throw()
- : __glibcxx_base_allocator<_Tp>(__a) { }
+ : __allocator_base<_Tp>(__a) { }
template<typename _Tp1>
allocator(const allocator<_Tp1>&) throw() { }
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;
+
/**
* @}
*/
#endif
// Undefine.
-#undef __glibcxx_base_allocator
+#undef __allocator_base
// To implement Option 3 of DR 431.
template<typename _Alloc, bool = __is_empty(_Alloc)>
{ return false; }
}
};
-
- // Declare uses_allocator so it can be specialized in <queue> etc.
- template<typename, typename>
- struct uses_allocator;
#endif
_GLIBCXX_END_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