/**
* @defgroup allocators Allocators
* @ingroup memory
*
* Classes encapsulating memory operations.
*/
template<typename _Tp>
class allocator;
/// allocator<void> specialization.
template<>
class allocator<void>
{
public:
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef void* pointer;
typedef const void* const_pointer;
typedef void value_type;
template<typename _Tp1>
struct rebind
{ typedef allocator<_Tp1> other; };
};
/**
* @brief The "standard" allocator, as per [20.4].
* @ingroup allocators
*
* Further details:
* http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt04ch11.html
*/
template<typename _Tp>
class allocator: public __glibcxx_base_allocator<_Tp>
{
public:
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef _Tp* pointer;
typedef const _Tp* const_pointer;
typedef _Tp& reference;
typedef const _Tp& const_reference;
typedef _Tp value_type;
template<typename _Tp1>
struct rebind
{ typedef allocator<_Tp1> other; };
allocator() throw() { }
allocator(const allocator& __a) throw()
: __glibcxx_base_allocator<_Tp>(__a) { }
template<typename _Tp1>
allocator(const allocator<_Tp1>&) throw() { }
~allocator() throw() { }
// Inherit everything else.
};
allocator
最新推荐文章于 2021-03-18 05:23:43 发布