![]() |
Home | Libraries | People | FAQ | More |
boost::container::allocator_traits
// In header: <boost/container/allocator_traits.hpp> template<typename Allocator> struct allocator_traits { // types typedef Allocator ; typedef ; typedef unspecified ; typedef see_documentation ; typedef see_documentation ; typedef see_documentation ; typedef see_documentation ; typedef see_documentation ; typedef see_documentation ; typedef see_documentation ; typedef see_documentation ; typedef see_documentation ; typedef see_documentation ; typedef see_documentation ; typedef see_documentation ; typedef see_documentation ; typedef allocator_traits< T > > ; // member classes/structs/unions template<typename T> struct portable_rebind_alloc { // types typedef see_documentation ; }; // public static functions (Allocator &, ); void (Allocator &, , ); (Allocator &, , ); template<typename T> void (Allocator &, T *) ; (const Allocator &) ; Allocator (const Allocator &); template<typename T, Args> void (Allocator &, T *, Args &&...); bool (const Allocator &, ) ; bool (const Allocator &, const Allocator &) ; };
The class template allocator_traits supplies a uniform interface to all allocator types. This class is a C++03-compatible implementation of std::allocator_traits
allocator_traits
public
typesAllocator::pointer if such a type exists; otherwise, value_type*
Allocator::const_pointer if such a type exists ; otherwise, pointer_traits<pointer>::rebind<const
Non-standard extension Allocator::reference if such a type exists; otherwise, value_type&
Non-standard extension Allocator::const_reference if such a type exists ; otherwise, const value_type&
Allocator::void_pointer if such a type exists ; otherwise, pointer_traits<pointer>::rebind<void>.
Allocator::const_void_pointer if such a type exists ; otherwise, pointer_traits<pointer>::rebind<const
Allocator::difference_type if such a type exists ; otherwise, pointer_traits<pointer>::difference_type.
Allocator::size_type if such a type exists ; otherwise, make_unsigned<difference_type>::type
Allocator::propagate_on_container_copy_assignment if such a type exists, otherwise a type with an internal constant static boolean member value
== false.
Allocator::propagate_on_container_move_assignment if such a type exists, otherwise a type with an internal constant static boolean member value
== false.
Allocator::propagate_on_container_swap if such a type exists, otherwise a type with an internal constant static boolean member value
== false.
Allocator::is_always_equal if such a type exists, otherwise a type with an internal constant static boolean member value
== is_empty<Allocator>::value
Allocator::is_partially_propagable if such a type exists, otherwise a type with an internal constant static boolean member value
== false Note: Non-standard extension used to implement small_vector_allocator
.
Defines an allocator: Allocator::rebind<T>::other if such a type exists; otherwise, Allocator<T, Args> if Allocator is a class template instantiation of the form Allocator<U, Args>, where Args is zero or more type arguments ; otherwise, the instantiation of rebind_alloc is ill-formed.
In C++03 compilers rebind_alloc
is a struct derived from an allocator deduced by previously detailed rules.
typedef allocator_traits< T > > ;
In C++03 compilers rebind_traits
is a struct derived from allocator_traits<OtherAlloc>
, where OtherAlloc
is the allocator deduced by rules explained in rebind_alloc
.
allocator_traits
public static functions(Allocator & a, n);
Returns: a.allocate(n)
void (Allocator & a, p, n);
Returns: a.deallocate(p, n)
Throws: Nothing
(Allocator & a, n, p);
Effects: calls a.allocate(n, p)
if that call is well-formed; otherwise, invokes a.allocate(n)
template<typename T> void (Allocator & a, T * p) ;
Effects: calls a.destroy(p)
if that call is well-formed; otherwise, invokes p->~T()
.
(const Allocator & a) ;
Returns: a.max_size()
if that expression is well-formed; otherwise, numeric_limits<size_type>::max()
.
Allocator (const Allocator & a);
Returns: a.select_on_container_copy_construction()
if that expression is well-formed; otherwise, a.
template<typename T, Args> void (Allocator & a, T * p, Args &&... args);
Effects: calls a.construct(p, std::forward<Args>(args)...)
if that call is well-formed; otherwise, invokes placement new
(static_cast<void*>(p)) T(std::forward<Args>(args)...)
bool (const Allocator & a, p) ;
Returns: a.storage_is_unpropagable(p)
if is_partially_propagable::value is true; otherwise, false
.
bool (const Allocator & a, const Allocator & b) ;
Returns: true
if is_always_equal::value == true
, otherwise, a == b
.