Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::container::allocator_traits< Alloc > Struct Template Reference

The class template allocator_traits supplies a uniform interface to all allocator types. More...

#include <allocator_traits.hpp>

Inheritance diagram for boost::container::allocator_traits< Alloc >:

Classes

struct  portable_rebind_alloc
 

Public Types

typedef Alloc allocator_type
 
typedef Alloc::value_type value_type
 
template<typename T >
using rebind_alloc = typename boost::intrusive::pointer_rebind< Alloc, T >::type
 
template<typename T >
using rebind_traits = allocator_traits< rebind_alloc< T > >
 

Public Member Functions

typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT (boost::container::container_detail::, Alloc, pointer, value_type *) pointer
 
typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_EVAL_DEFAULT (boost::container::container_detail::, Alloc, const_pointer, typename boost::intrusive::pointer_traits< pointer >::template rebind_pointer< const value_type >) const _pointer
 
typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT (boost::container::container_detail::, Alloc, reference, typename container_detail::unvoid< value_type >::type &) reference
 
typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT (boost::container::container_detail::, Alloc, const_reference, const typename container_detail::unvoid< value_type >::type &) const _reference
 
typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_EVAL_DEFAULT (boost::container::container_detail::, Alloc, void_pointer, typename boost::intrusive::pointer_traits< pointer >::template rebind_pointer< void >) void_pointer
 
typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_EVAL_DEFAULT (boost::container::container_detail::, Alloc, const_void_pointer, typename boost::intrusive::pointer_traits< pointer >::template rebind_pointer< const void >) const _void_pointer
 
typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT (boost::container::container_detail::, Alloc, difference_type, std::ptrdiff_t) difference_type
 
typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT (boost::container::container_detail::, Alloc, size_type, std::size_t) size_type
 
typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT (boost::container::container_detail::, Alloc, propagate_on_container_copy_assignment, container_detail::false_type) propagate_on_container_copy_assignment
 
typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT (boost::container::container_detail::, Alloc, propagate_on_container_move_assignment, container_detail::false_type) propagate_on_container_move_assignment
 
typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT (boost::container::container_detail::, Alloc, propagate_on_container_swap, container_detail::false_type) propagate_on_container_swap
 

Static Public Member Functions

static pointer allocate (Alloc &a, size_type n)
 Returns: a.allocate(n) More...
 
static void deallocate (Alloc &a, pointer p, size_type n)
 Returns: a.deallocate(p, n) More...
 
static pointer allocate (Alloc &a, size_type n, const_void_pointer p)
 Effects: calls a.allocate(n, p) if that call is well-formed; otherwise, invokes a.allocate(n) More...
 
template<class T >
static void destroy (Alloc &a, T *p) BOOST_CONTAINER_NOEXCEPT
 Effects: calls a.destroy(p) if that call is well-formed; otherwise, invokes p->~T(). More...
 
static size_type max_size (const Alloc &a) BOOST_CONTAINER_NOEXCEPT
 Returns: a.max_size() if that expression is well-formed; otherwise, numeric_limits<size_type>::max(). More...
 
static container_detail::if_c
< boost::container::container_detail::has_member_function_callable_with_select_on_container_copy_construction
< const Alloc >::value, Alloc,
const Alloc & >::type 
select_on_container_copy_construction (const Alloc &a)
 Returns: a.select_on_container_copy_construction() if that expression is well-formed; otherwise, a. More...
 
template<class T , class... Args>
static void construct (Alloc &a, T *p, BOOST_FWD_REF(Args)...args)
 Effects: calls a.construct(p, std::forward<Args>(args)...) if that call is well-formed; otherwise, invokes ::new (static_cast<void*>(p)) T(std::forward<Args>(args)...) More...
 

Detailed Description

template<typename Alloc>
struct boost::container::allocator_traits< Alloc >

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

Member Typedef Documentation

template<typename Alloc>
typedef Alloc boost::container::allocator_traits< Alloc >::allocator_type
template<typename Alloc>
template<typename T >
using boost::container::allocator_traits< Alloc >::rebind_alloc = typename boost::intrusive::pointer_rebind<Alloc, T>::type
template<typename Alloc>
template<typename T >
using boost::container::allocator_traits< Alloc >::rebind_traits = allocator_traits< rebind_alloc<T> >
template<typename Alloc>
typedef Alloc::value_type boost::container::allocator_traits< Alloc >::value_type

Member Function Documentation

template<typename Alloc>
static pointer boost::container::allocator_traits< Alloc >::allocate ( Alloc &  a,
size_type  n 
)
inlinestatic

Returns: a.allocate(n)

template<typename Alloc>
static pointer boost::container::allocator_traits< Alloc >::allocate ( Alloc &  a,
size_type  n,
const_void_pointer  p 
)
inlinestatic

Effects: calls a.allocate(n, p) if that call is well-formed; otherwise, invokes a.allocate(n)

template<typename Alloc>
typedef boost::container::allocator_traits< Alloc >::BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT ( boost::container::container_detail::  ,
Alloc  ,
pointer  ,
value_type  
)
template<typename Alloc>
typedef boost::container::allocator_traits< Alloc >::BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT ( boost::container::container_detail::  ,
Alloc  ,
reference  ,
typename container_detail::unvoid< value_type >::type  
)
template<typename Alloc>
typedef boost::container::allocator_traits< Alloc >::BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT ( boost::container::container_detail::  ,
Alloc  ,
const_reference  ,
const typename container_detail::unvoid< value_type >::type  
) const
template<typename Alloc>
typedef boost::container::allocator_traits< Alloc >::BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT ( boost::container::container_detail::  ,
Alloc  ,
difference_type  ,
std::ptrdiff_t   
)
template<typename Alloc>
typedef boost::container::allocator_traits< Alloc >::BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT ( boost::container::container_detail::  ,
Alloc  ,
size_type  ,
std::size_t   
)
template<typename Alloc>
typedef boost::container::allocator_traits< Alloc >::BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT ( boost::container::container_detail::  ,
Alloc  ,
propagate_on_container_copy_assignment  ,
container_detail::false_type   
)
template<typename Alloc>
typedef boost::container::allocator_traits< Alloc >::BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT ( boost::container::container_detail::  ,
Alloc  ,
propagate_on_container_move_assignment  ,
container_detail::false_type   
)
template<typename Alloc>
typedef boost::container::allocator_traits< Alloc >::BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT ( boost::container::container_detail::  ,
Alloc  ,
propagate_on_container_swap  ,
container_detail::false_type   
)
template<typename Alloc>
typedef boost::container::allocator_traits< Alloc >::BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_EVAL_DEFAULT ( boost::container::container_detail::  ,
Alloc  ,
const_pointer  ,
typename boost::intrusive::pointer_traits< pointer >::template rebind_pointer< const value_type  
) const
template<typename Alloc>
typedef boost::container::allocator_traits< Alloc >::BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_EVAL_DEFAULT ( boost::container::container_detail::  ,
Alloc  ,
void_pointer  ,
typename boost::intrusive::pointer_traits< pointer >::template rebind_pointer< void >   
)
template<typename Alloc>
typedef boost::container::allocator_traits< Alloc >::BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_EVAL_DEFAULT ( boost::container::container_detail::  ,
Alloc  ,
const_void_pointer  ,
typename boost::intrusive::pointer_traits< pointer >::template rebind_pointer< const void >   
) const
template<typename Alloc>
template<class T , class... Args>
static void boost::container::allocator_traits< Alloc >::construct ( Alloc &  a,
T p,
BOOST_FWD_REF(Args)...  args 
)
inlinestatic

Effects: calls a.construct(p, std::forward<Args>(args)...) if that call is well-formed; otherwise, invokes ::new (static_cast<void*>(p)) T(std::forward<Args>(args)...)

Referenced by boost::container::container_detail::dispatch_allocator_prefix_suffix(), boost::container::container_detail::dispatch_uses_allocator(), and boost::circular_buffer< Sample >::linearize().

template<typename Alloc>
static void boost::container::allocator_traits< Alloc >::deallocate ( Alloc &  a,
pointer  p,
size_type  n 
)
inlinestatic

Returns: a.deallocate(p, n)

Throws: Nothing

template<typename Alloc>
template<class T >
static void boost::container::allocator_traits< Alloc >::destroy ( Alloc &  a,
T p 
)
inlinestatic

Effects: calls a.destroy(p) if that call is well-formed; otherwise, invokes p->~T().

template<typename Alloc>
static size_type boost::container::allocator_traits< Alloc >::max_size ( const Alloc &  a)
inlinestatic

Returns: a.max_size() if that expression is well-formed; otherwise, numeric_limits<size_type>::max().

Referenced by boost::circular_buffer< Sample >::max_size().

template<typename Alloc>
static container_detail::if_c< boost::container::container_detail:: has_member_function_callable_with_select_on_container_copy_construction <const Alloc>::value , Alloc , const Alloc & >::type boost::container::allocator_traits< Alloc >::select_on_container_copy_construction ( const Alloc &  a)
inlinestatic

Returns: a.select_on_container_copy_construction() if that expression is well-formed; otherwise, a.


The documentation for this struct was generated from the following file: