Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class template small_vector_allocator

boost::container::small_vector_allocator

Synopsis

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

template<typename T, typename VoidAlloc = void, typename Options = void> 
class small_vector_allocator : public  {
public:
  // types
  typedef allocator_traits<                              ;                            
  typedef allocator_traits<                                 ;                               
  typedef allocator_traits<                           ;                         
  typedef allocator_traits<                               ;                             
  typedef allocator_traits<                         ;                       
  typedef allocator_traits<                               ;                             
  typedef allocator_traits<                         ;                       
  typedef allocator_traits<                            ;                          
  typedef allocator_traits<                      ;                    
  typedef allocator_traits<  ;
  typedef allocator_traits<  ;
  typedef allocator_traits<             ;           
  typedef implementation_defined                                                     ;                         // An integral constant with member value == false
  typedef implementation_defined                                                     ;                 // An integral constant with member value == true

  // construct/copy/destruct
  () ;
  (const small_vector_allocator &) ;
  (small_vector_allocator &&) ;
  template<typename U, typename OtherVoidAllocator, typename OtherOptions> 
    (const small_vector_allocator< U, OtherVoidAllocator, OtherOptions > &) ;
  template<typename U, typename OtherVoidAllocator, typename OtherOptions> 
    (small_vector_allocator< U BOOST_MOVE_I OtherVoidAllocator BOOST_MOVE_I OtherOptions > &&) ;
  (const ) ;
  small_vector_allocator & (const small_vector_allocator &) ;
  small_vector_allocator & (small_vector_allocator &&) ;
  template<typename U, typename OtherVoidAllocator> 
    small_vector_allocator & 
    (const small_vector_allocator< U BOOST_MOVE_I OtherVoidAllocator BOOST_MOVE_I Options > &) ;
  template<typename U, typename OtherVoidAllocator> 
    small_vector_allocator & 
    (small_vector_allocator< U BOOST_MOVE_I OtherVoidAllocator BOOST_MOVE_I Options > &&) ;
  small_vector_allocator & (const ) ;

  // public member functions
   (typedef small_vector_allocator BOOST_CONTAINER_I );
  pointer (size_type, const_void_pointer = const_void_pointer());
  void (pointer, size_type) ;
  size_type () ;
  small_vector_allocator () ;
  bool (pointer) ;

  // friend functions
  void (small_vector_allocator &, small_vector_allocator &) ;
  bool (const small_vector_allocator &, 
                  const small_vector_allocator &) ;
  bool (const small_vector_allocator &, 
                  const small_vector_allocator &) ;
};

Description

A non-standard allocator used to implement small_vector. Users should never use it directly. It is described here for documentation purposes.

This allocator inherits from a standard-conforming allocator and forwards member functions to the standard allocator except when internal storage is being used as memory source.

This allocator is a "partially_propagable" allocator and defines is_partially_propagable as true_type.

A partially propagable allocator means that not all storage allocatod by an instance of small_vector_allocator can be deallocated by another instance of this type, even if both instances compare equal or an instance is propagated to another one using the copy/move constructor or assignment. The storage that can never be propagated is identified by storage_is_unpropagable(p).

boost::container::vector supports partially propagable allocators fallbacking to deep copy/swap/move operations when internal storage is being used to store vector elements.

small_vector_allocator assumes that will be instantiated as boost::container::vector< T, small_vector_allocator<T, Allocator> > and internal storage can be obtained downcasting that vector to small_vector_base<T>.

small_vector_allocator public construct/copy/destruct

  1. () ;
  2. (const small_vector_allocator & other) ;

    Constructor from other small_vector_allocator. Never throws

  3. (small_vector_allocator && other) ;

    Move constructor from small_vector_allocator. Never throws

  4. template<typename U, typename OtherVoidAllocator, typename OtherOptions> 
      (const small_vector_allocator< U, OtherVoidAllocator, OtherOptions > & other) ;

    Constructor from related small_vector_allocator. Never throws

  5. template<typename U, typename OtherVoidAllocator, typename OtherOptions> 
      (small_vector_allocator< U BOOST_MOVE_I OtherVoidAllocator BOOST_MOVE_I OtherOptions > && other) ;

    Move constructor from related small_vector_allocator. Never throws

  6. (const  other) ;

    Constructor from allocator_type. Never throws

  7. small_vector_allocator & 
    (const small_vector_allocator & other) ;

    Assignment from other small_vector_allocator. Never throws

  8. small_vector_allocator & (small_vector_allocator && other) ;

    Move assignment from other small_vector_allocator. Never throws

  9. template<typename U, typename OtherVoidAllocator> 
      small_vector_allocator & 
      (const small_vector_allocator< U BOOST_MOVE_I OtherVoidAllocator BOOST_MOVE_I Options > & other) ;

    Assignment from related small_vector_allocator. Never throws

  10. template<typename U, typename OtherVoidAllocator> 
      small_vector_allocator & 
      (small_vector_allocator< U BOOST_MOVE_I OtherVoidAllocator BOOST_MOVE_I Options > && other) ;

    Move assignment from related small_vector_allocator. Never throws

  11. small_vector_allocator & (const  other) ;

    Move assignment from allocator_type. Never throws

small_vector_allocator public member functions

  1.  (typedef small_vector_allocator BOOST_CONTAINER_I );

    Obtains an small_vector_allocator that allocates objects of type T2

  2. pointer (size_type count, 
                     const_void_pointer hint = const_void_pointer());
    Allocates storage from the standard-conforming allocator.
  3. void (pointer ptr, size_type n) ;

    Deallocates previously allocated memory. Never throws

  4. size_type () ;

    Returns the maximum number of elements that could be allocated. Never throws

  5. small_vector_allocator () ;
  6. bool (pointer p) ;

small_vector_allocator friend functions

  1. void (small_vector_allocator & l, small_vector_allocator & r) ;

    Swaps two allocators, does nothing because this small_vector_allocator is stateless

  2. bool (const small_vector_allocator & l, 
                    const small_vector_allocator & r) ;

    An small_vector_allocator always compares to true, as memory allocated with one instance can be deallocated by another instance (except for unpropagable storage)

  3. bool (const small_vector_allocator & l, 
                    const small_vector_allocator & r) ;

    An small_vector_allocator always compares to false, as memory allocated with one instance can be deallocated by another instance


PrevUpHomeNext