Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Struct template allocator_traits

boost::container::allocator_traits

Synopsis

// In header: <boost/container/allocator_traits.hpp>

template<typename Allocator> 
struct allocator_traits {
  // types
  typedef                              ;                        
  typedef             ;                            
  typedef                            ;                               
  typedef                      ;                         
  typedef                      ;                             
  typedef                      ;                       
  typedef                      ;                          
  typedef                      ;                    
  typedef                      ;                       
  typedef                      ;                             
  typedef                      ;
  typedef                      ;
  typedef                      ;           
  typedef                      ;                       
  typedef                      ;               
  typedef                      ;                          
  typedef allocator_traits<  ;                         

  // member classes/structs/unions
  template<typename T> 
  struct portable_rebind_alloc {
    // types
    typedef  ;
  };

  // public static functions
   (, );
   (, , );
   (, , );
  template<typename T>  (, ) ;
   () ;
   ();
  template<typename T,  Args> 
     (, , );
   (, ) ;
   (, ) ;
};

Description

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 types

  1. typedef ;

    Allocator::pointer if such a type exists; otherwise, value_type*

  2. typedef ;

    Allocator::const_pointer if such a type exists ; otherwise, pointer_traits<pointer>::rebind<const

  3. typedef ;

    Non-standard extension Allocator::reference if such a type exists; otherwise, value_type&

  4. typedef ;

    Non-standard extension Allocator::const_reference if such a type exists ; otherwise, const value_type&

  5. typedef ;

    Allocator::void_pointer if such a type exists ; otherwise, pointer_traits<pointer>::rebind<void>.

  6. typedef ;

    Allocator::const_void_pointer if such a type exists ; otherwise, pointer_traits<pointer>::rebind<const

  7. typedef ;

    Allocator::difference_type if such a type exists ; otherwise, pointer_traits<pointer>::difference_type.

  8. typedef ;

    Allocator::size_type if such a type exists ; otherwise, make_unsigned<difference_type>::type

  9. typedef ;

    Allocator::propagate_on_container_copy_assignment if such a type exists, otherwise a type with an internal constant static boolean member value == false.

  10. typedef ;

    Allocator::propagate_on_container_move_assignment if such a type exists, otherwise a type with an internal constant static boolean member value == false.

  11. typedef ;

    Allocator::propagate_on_container_swap if such a type exists, otherwise a type with an internal constant static boolean member value == false.

  12. typedef ;

    Allocator::is_always_equal if such a type exists, otherwise a type with an internal constant static boolean member value == is_empty<Allocator>::value

  13. typedef ;

    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.

  14. typedef ;

    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.

  15. typedef allocator_traits< ;

    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

  1.  ( a,  n);

    Returns: a.allocate(n)

  2.  ( a,  p,  n);

    Returns: a.deallocate(p, n)

    Throws: Nothing

  3.  ( a,  n,  p);

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

  4. template<typename T>  ( a,  p) ;

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

  5.  ( a) ;

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

  6.  ( a);

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

  7. template<typename T,  Args> 
       ( a,  p,  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)...)

  8.  ( a,  p) ;

    Returns: a.storage_is_unpropagable(p) if is_partially_propagable::value is true; otherwise, false.

  9.  ( a,  b) ;

    Returns: true if is_always_equal::value == true, otherwise, a == b.


PrevUpHomeNext