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 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 &) ;
};

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 unspecified ;

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

  2. typedef see_documentation ;

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

  3. typedef see_documentation ;

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

  4. typedef see_documentation ;

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

  5. typedef see_documentation ;

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

  6. typedef see_documentation ;

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

  7. typedef see_documentation ;

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

  8. typedef see_documentation ;

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

  9. typedef see_documentation ;

    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 see_documentation ;

    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 see_documentation ;

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

  12. typedef see_documentation ;

    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 see_documentation ;

    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 see_documentation ;

    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< 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

  1.  (Allocator & a,  n);

    Returns: a.allocate(n)

  2. void (Allocator & a,  p,  n);

    Returns: a.deallocate(p, n)

    Throws: Nothing

  3.  (Allocator & a,  n,  p);

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

  4. template<typename T> void (Allocator & a, T * p) ;

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

  5.  (const Allocator & a) ;

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

  6. Allocator (const Allocator & a);

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

  7. 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)...)

  8. bool (const Allocator & a,  p) ;

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

  9. bool (const Allocator & a, const Allocator & b) ;

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


PrevUpHomeNext