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, typename Options> 
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                                                      ;                         // An integral constant with member value == false
  typedef                                                      ;                 // An integral constant with member value == true

  // public member functions
   (small_vector_allocator );
  () ;
  (small_vector_allocator &) ;
  (small_vector_allocator &&) ;
  template<typename U, typename OtherVoidAllocator, typename OtherOptions> 
    (small_vector_allocator< ) ;
  template<typename U, typename OtherVoidAllocator, typename OtherOptions> 
    (small_vector_allocator< ) ;
  () ;
  small_vector_allocator & (small_vector_allocator &) ;
  small_vector_allocator & (small_vector_allocator &&) ;
  template<typename U, typename OtherVoidAllocator> 
    small_vector_allocator & 
    (small_vector_allocator< ) ;
  template<typename U, typename OtherVoidAllocator> 
    small_vector_allocator & 
    (small_vector_allocator< ) ;
  small_vector_allocator & () ;
   (,  = );
   (, ) ;
   () ;
  small_vector_allocator () ;
   () ;

  // friend functions
   (small_vector_allocator &, small_vector_allocator &) ;
   (small_vector_allocator &, 
                  small_vector_allocator &) ;
   (small_vector_allocator &, 
                  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 member functions

  1.  (small_vector_allocator );

    Obtains an small_vector_allocator that allocates objects of type T2

  2. () ;
  3. (small_vector_allocator & other) ;

    Constructor from other small_vector_allocator. Never throws

  4. (small_vector_allocator && other) ;

    Move constructor from small_vector_allocator. Never throws

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

    Constructor from related small_vector_allocator. Never throws

  6. template<typename U, typename OtherVoidAllocator, typename OtherOptions> 
      (small_vector_allocator<  other) ;

    Move constructor from related small_vector_allocator. Never throws

  7. ( other) ;

    Constructor from allocator_type. Never throws

  8. small_vector_allocator & 
    (small_vector_allocator & other) ;

    Assignment from other small_vector_allocator. Never throws

  9. small_vector_allocator & (small_vector_allocator && other) ;

    Move assignment from other small_vector_allocator. Never throws

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

    Assignment from related small_vector_allocator. Never throws

  11. template<typename U, typename OtherVoidAllocator> 
      small_vector_allocator & 
      (small_vector_allocator<  other) ;

    Move assignment from related small_vector_allocator. Never throws

  12. small_vector_allocator & ( other) ;

    Move assignment from allocator_type. Never throws

  13.  ( count,  hint = );
    Allocates storage from the standard-conforming allocator.
  14.  ( ptr,  n) ;

    Deallocates previously allocated memory. Never throws

  15.  () ;

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

  16. small_vector_allocator () ;
  17.  ( p) ;

small_vector_allocator friend functions

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

    Swaps two allocators, does nothing because this small_vector_allocator is stateless

  2.  (small_vector_allocator & l, 
                    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.  (small_vector_allocator & l, 
                    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