Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class template devector

boost::container::devector

Synopsis

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

template<typename T, typename A, typename Options> 
class devector {
public:
  // types
  typedef                                                    ;            
  typedef                               ;        
  typedef                                       ; 
  typedef allocator_traits<          ;               
  typedef allocator_traits<    ;         
  typedef allocator_traits<        ;             
  typedef allocator_traits<  ;       
  typedef allocator_traits<        ;             
  typedef allocator_traits<  ;       
  typedef                                              ;              
  typedef                                        ;        
  typedef                               ;      
  typedef                               ;

  // public member functions
  () ;
  () ;
  (, ,  = );
  (, , , 
            = );
  (,  = );
  (, default_init_t,  = );
  (, ,  = );
  template<typename InputIterator> 
    (, ,  = );
  (devector &);
  (devector &, );
  (devector &&) ;
  (devector &&, );
  (,  = );
  ~() ;
  devector & (devector &);
  devector & (devector &&) ;
  devector & ();
  template<typename InputIterator> 
     (, );
   (, );
   ();
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
   ();
   (, default_init_t);
   (, );
   ();
   (, default_init_t);
   (, );
   ();
   (, default_init_t);
   (, );
   ();
   ();
   ();
   ();
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
   ();
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
  template< Args>  ();
   ();
   ();
   () ;
  template< Args>  ();
   ();
   ();
   () ;
  template< Args>  (, );
   (, );
   (, );
   (, , );
  template<typename InputIterator> 
     (, , );
   (, );
   ();
   (, );
   (, );
   (devector &) ;
   () ;

  // private member functions
   (devector &&, );
   (devector &&, );
   () ;
   () ;
   () ;
   () ;

  // private static functions
   ();
};

Description

A vector-like sequence container providing front and back operations (e.g: push_front/pop_front/push_back/pop_back) with amortized constant complexity.

Models the SequenceContainer, ReversibleContainer, and AllocatorAwareContainer concepts.

Requires:

  • T shall be MoveInsertable into the devector.

  • T shall be Erasable from any devector<T, allocator_type, GP>.

  • GrowthFactor, and Allocator must model the concepts with the same names or be void.

Definition: T is NothrowConstructible if it's either nothrow move constructible or nothrow copy constructible.

Definition: T is NothrowAssignable if it's either nothrow move assignable or nothrow copy assignable.

Exceptions: The exception specifications assume T is nothrow Destructible.

Most methods providing the strong exception guarantee assume T either has a move constructor marked noexcept or is CopyInsertable into the devector. If it isn't true, and the move constructor throws, the guarantee is waived and the effects are unspecified.

In addition to the exceptions specified in the Throws clause, the following operations of T can throw when any of the specified concept is required:

Furthermore, not noexcept methods throws whatever the allocator throws if memory allocation fails. Such methods also throw length_error if the capacity exceeds max_size().

Remark: If a method invalidates some iterators, it also invalidates references and pointers to the elements pointed by the invalidated iterators.

!

Template Parameters

  1. typename T
  2. typename A
  3. typename Options

    A type produced from boost::container::devector_options.

devector public member functions

  1. () ;

    Effects: Constructs an empty devector.

    Postcondition: empty() && front_free_capacity() == 0 && back_free_capacity() == 0.

    Complexity: Constant.

  2. ( allocator) ;

    Effects: Constructs an empty devector, using the specified allocator.

    Postcondition: empty() && front_free_capacity() == 0 && back_free_capacity() == 0.

    Complexity: Constant.

  3. ( n, ,  allocator = );

    Effects: Constructs an empty devector, using the specified allocator and reserves n slots as if reserve(n) was called.

    Postcondition: empty() && capacity() >= n.

    Exceptions: Strong exception guarantee.

    Complexity: Constant.

  4. ( front_free_cap,  back_free_cap, 
             ,  allocator = );

    Effects: Constructs an empty devector, using the specified allocator and reserves at least front_free_cap + back_free_cap slots as if reserve_front(front_cap) and reserve_back(back_cap) was called.

    Postcondition: empty() && front_free_capacity() >= front_free_cap && back_free_capacity() >= back_free_cap.

    Exceptions: Strong exception guarantee.

    Complexity: Constant.

  5. ( n,  allocator = );

    Effects: Constructs a devector with n value_initialized elements using the specified allocator.

    Requires: T shall be DefaultInsertable into *this.

    Postcondition: size() == n.

    Exceptions: Strong exception guarantee.

    Complexity: Linear in n.

  6. ( n, default_init_t, 
                       allocator = );

    Effects: Constructs a devector with n default-initialized elements using the specified allocator.

    Requires: T shall be [DefaultInsertable] into *this.

    Postcondition: size() == n.

    Exceptions: Strong exception guarantee.

    Complexity: Linear in n.

  7. ( n,  value,  allocator = );

    Effects: Constructs a devector with n copies of value, using the specified allocator.

    Requires: T shall be CopyInsertable into *this.

    Postcondition: size() == n.

    Exceptions: Strong exception guarantee.

    Complexity: Linear in n.

  8. template<typename InputIterator> 
      ( first,  last, 
                allocator = );

    Effects: Constructs a devector equal to the range [first,last), using the specified allocator.

    Requires: T shall be EmplaceConstructible into *this from *first. If the specified iterator does not meet the forward iterator requirements, T shall also be MoveInsertable into *this.

    Postcondition: `size() == boost::container::iterator_distance(first, last)

    Exceptions: Strong exception guarantee.

    Complexity: Makes only N calls to the copy constructor of T (where N is the distance between first and last), at most one allocation and no reallocations if iterators first and last are of forward, bidirectional, or random access categories. It makes O(N) calls to the copy constructor of T and `O(log(N)) reallocations if they are just input iterators.

    Remarks: Each iterator in the range [first,last) shall be dereferenced exactly once, unless an exception is thrown.

  9. (devector & x);

    Effects: Copy constructs a devector.

    Requires: T shall be CopyInsertable into *this.

    Postcondition: this->size() == x.size().

    Exceptions: Strong exception guarantee.

    Complexity: Linear in the size of x.

  10. (devector & x,  allocator);

    Effects: Copy constructs a devector, using the specified allocator.

    Requires: T shall be CopyInsertable into *this.

    Postcondition: *this == x.

    Exceptions: Strong exception guarantee.

    Complexity: Linear in the size of x.

  11. (devector && rhs) ;

    Effects: Moves rhs's resources to *this.

    Throws: Nothing.

    Postcondition: *this has the same value rhs had before the operation. rhs is left in an unspecified but valid state.

    Exceptions: Strong exception guarantee if not noexcept.

    Complexity: Constant.

  12. (devector && rhs,  allocator);

    Effects: Moves rhs's resources to *this, using the specified allocator.

    Throws: If allocation or T's move constructor throws.

    Postcondition: *this has the same value rhs had before the operation. rhs is left in an unspecified but valid state.

    Exceptions: Strong exception guarantee if not noexcept.

    Complexity: Linear if allocator != rhs.get_allocator(), otherwise constant.

  13. ( il, 
              allocator = );

    Equivalent to: devector(il.begin(), il.end(), allocator).

  14. ~() ;

    Effects: Destroys the devector. All stored values are destroyed and used memory, if any, deallocated.

    Complexity: Linear in the size of *this.

  15. devector & (devector & rhs);

    Effects: Copies elements of x to *this. Previously held elements get copy assigned to or destroyed.

    Requires: T shall be CopyInsertable into *this.

    Postcondition: this->size() == x.size(), the elements of *this are copies of elements in x in the same order.

    Returns: *this.

    Exceptions: Strong exception guarantee if T is NothrowConstructible and the allocator is allowed to be propagated (propagate_on_container_copy_assignment is true), Basic exception guarantee otherwise.

    Complexity: Linear in the size of x and *this.

  16. devector & (devector && x) ;

    Effects: Moves elements of x to *this. Previously held elements get move/copy assigned to or destroyed.

    Requires: T shall be MoveInsertable into *this.

    Postcondition: x is left in an unspecified but valid state.

    Returns: *this.

    Exceptions: Basic exception guarantee if not noexcept.

    Complexity: Constant if allocator_traits_type:: propagate_on_container_move_assignment is true or this->get>allocator() == x.get_allocator(). Linear otherwise.

  17. devector & ( il);

    Effects: Copies elements of il to *this. Previously held elements get copy assigned to or destroyed.

    Requires: T shall be CopyInsertable into *this and CopyAssignable.

    Postcondition: this->size() == il.size(), the elements of *this are copies of elements in il in the same order.

    Exceptions: Strong exception guarantee if T is nothrow copy assignable from T and NothrowConstructible, Basic exception guarantee otherwise.

    Returns: *this.

    Complexity: Linear in the size of il and *this.

  18. template<typename InputIterator> 
       ( first,  BOOST_CONTAINER_DOCIGN);

    Effects: Replaces elements of *this with a copy of [first,last). Previously held elements get copy assigned to or destroyed.

    Requires: T shall be EmplaceConstructible from *first. If the specified iterator does not meet the forward iterator requirements, T shall be also MoveInsertable into *this.

    Precondition: first and last are not iterators into *this.

    Postcondition: size() == N, where N is the distance between first and last.

    Exceptions: Strong exception guarantee if T is nothrow copy assignable from *first and NothrowConstructible, Basic exception guarantee otherwise.

    Complexity: Linear in the distance between first and last. Makes a single reallocation at most if the iterators first and last are of forward, bidirectional, or random access categories. It makes O(log(N)) reallocations if they are just input iterators.

    Remarks: Each iterator in the range [first,last) shall be dereferenced exactly once, unless an exception is thrown.

  19.  ( n,  u);

    Effects: Replaces elements of *this with n copies of u. Previously held elements get copy assigned to or destroyed.

    Requires: T shall be CopyInsertable into *this and CopyAssignable.

    Precondition: u is not a reference into *this.

    Postcondition: size() == n and the elements of *this are copies of u.

    Exceptions: Strong exception guarantee if T is nothrow copy assignable from u and NothrowConstructible, Basic exception guarantee otherwise.

    Complexity: Linear in n and the size of *this.

  20.  ( il);

    Equivalent to: assign(il.begin(), il.end()).

  21.  () ;

    Returns: A copy of the allocator associated with the container.

    Complexity: Constant.

  22.  () ;
  23.  () ;
  24.  () ;

    Returns: A iterator pointing to the first element in the devector, or the past the end iterator if the devector is empty.

    Complexity: Constant.

  25.  () ;

    Returns: A constant iterator pointing to the first element in the devector, or the past the end iterator if the devector is empty.

    Complexity: Constant.

  26.  () ;

    Returns: An iterator pointing past the last element of the container.

    Complexity: Constant.

  27.  () ;

    Returns: A constant iterator pointing past the last element of the container.

    Complexity: Constant.

  28.  () ;

    Returns: A reverse iterator pointing to the first element in the reversed devector, or the reverse past the end iterator if the devector is empty.

    Complexity: Constant.

  29.  () ;

    Returns: A constant reverse iterator pointing to the first element in the reversed devector, or the reverse past the end iterator if the devector is empty.

    Complexity: Constant.

  30.  () ;

    Returns: A reverse iterator pointing past the last element in the reversed container, or to the beginning of the reversed container if it's empty.

    Complexity: Constant.

  31.  () ;

    Returns: A constant reverse iterator pointing past the last element in the reversed container, or to the beginning of the reversed container if it's empty.

    Complexity: Constant.

  32.  () ;

    Returns: A constant iterator pointing to the first element in the devector, or the past the end iterator if the devector is empty.

    Complexity: Constant.

  33.  () ;

    Returns: A constant iterator pointing past the last element of the container.

    Complexity: Constant.

  34.  () ;

    Returns: A constant reverse iterator pointing to the first element in the reversed devector, or the reverse past the end iterator if the devector is empty.

    Complexity: Constant.

  35.  () ;

    Returns: A constant reverse iterator pointing past the last element in the reversed container, or to the beginning of the reversed container if it's empty.

    Complexity: Constant.

  36.  () ;

    Returns: True, if size() == 0, false otherwise.

    Complexity: Constant.

  37.  () ;

    Returns: The number of elements the devector contains.

    Complexity: Constant.

  38.  () ;

    Returns: The maximum number of elements the devector could possibly hold.

    Complexity: Constant.

  39.  () ;

    Returns: The minimum number of elements that can be inserted into devector using position-based insertions without requiring a reallocation. Note that, unlike in typical sequence containers like vector, capacity(), capacity() can be smaller than size(). This can happen if a user inserts elements in a particular way (usually inserting at front up to front_free_capacity() and at back up to back_free_capacity()).

    Complexity: Constant.

  40.  () ;

    Returns: The total number of elements that can be pushed to the front of the devector without requiring reallocation.

    Complexity: Constant.

  41.  () ;

    Returns: The total number of elements that can be pushed to the back of the devector without requiring reallocation.

    Complexity: Constant.

  42.  ( sz);

    Effects: If sz is greater than the size of *this, additional value-initialized elements are inserted. Invalidates iterators if reallocation is needed. If sz is smaller than than the size of *this, elements are erased from the extremes.

    Requires: T shall be MoveInsertable into *this and DefaultConstructible.

    Postcondition: sz == size().

    Exceptions: Strong exception guarantee.

    Complexity: Linear in the size of *this and sz.

  43.  ( sz, default_init_t);

    Effects: Same as resize(sz) but creates default-initialized value-initialized.

  44.  ( sz,  c);

    Effects: If sz is greater than the size of *this, copies of c are inserted at extremes. If sz is smaller than than the size of *this, elements are popped from the extremes.

    Postcondition: sz == size().

    Requires: T shall be CopyInsertable into *this.

    Exceptions: Strong exception guarantee.

    Complexity: Linear in the size of *this and sz.

  45.  ( sz);

    Effects: If sz is greater than the size of *this, additional value-initialized elements are inserted to the front. Invalidates iterators if reallocation is needed. If sz is smaller than than the size of *this, elements are popped from the front.

    Requires: T shall be MoveInsertable into *this and DefaultConstructible.

    Postcondition: sz == size().

    Exceptions: Strong exception guarantee.

    Complexity: Linear in the size of *this and sz.

  46.  ( sz, default_init_t);

    Effects: If sz is greater than the size of *this, additional value-initialized elements are inserted to the front. Invalidates iterators if reallocation is needed. If sz is smaller than than the size of *this, elements are popped from the front.

    Requires: T shall be MoveInsertable into *this and default_initializable.

    Postcondition: sz == size().

    Exceptions: Strong exception guarantee.

    Complexity: Linear in the size of *this and sz.

  47.  ( sz,  c);

    Effects: If sz is greater than the size of *this, copies of c are inserted to the front. Invalidates iterators if reallocation is needed. If sz is smaller than than the size of *this, elements are popped from the front.

    Postcondition: sz == size().

    Requires: T shall be CopyInsertable into *this.

    Exceptions: Strong exception guarantee.

    Complexity: Linear in the size of *this and sz.

  48.  ( sz);

    Effects: If sz is greater than the size of *this, additional value-initialized elements are inserted to the back. Invalidates iterators if reallocation is needed. If sz is smaller than than the size of *this, elements are popped from the back.

    Requires: T shall be MoveInsertable into *this and DefaultConstructible.

    Postcondition: sz == size().

    Exceptions: Strong exception guarantee.

    Complexity: Linear in the size of *this and sz.

  49.  ( sz, default_init_t);

    Effects: If sz is greater than the size of *this, additional value-initialized elements are inserted to the back. Invalidates iterators if reallocation is needed. If sz is smaller than than the size of *this, elements are popped from the back.

    Requires: T shall be MoveInsertable into *this and default initializable.

    Postcondition: sz == size().

    Exceptions: Strong exception guarantee.

    Complexity: Linear in the size of *this and sz.

  50.  ( sz,  c);

    Effects: If sz is greater than the size of *this, copies of c are inserted to the back. If sz is smaller than than the size of *this, elements are popped from the back.

    Postcondition: sz == size().

    Requires: T shall be CopyInsertable into *this.

    Exceptions: Strong exception guarantee.

    Complexity: Linear in the size of *this and sz.

  51.  ( new_capacity);

    Effects: Ensures that at least n elements can be inserted without requiring reallocation, where n is new_capacity - size(), if n is positive. Otherwise, there are no effects. Invalidates iterators if reallocation is needed.

    Requires: T shall be MoveInsertable into *this.

    Complexity: Linear in the size of *this.

    Exceptions: Strong exception guarantee.

    Throws: length_error if new_capacity > max_size().

  52.  ( new_capacity);

    Effects: Ensures that n elements can be pushed to the front without requiring reallocation, where n is new_capacity - size(), if n is positive. Otherwise, there are no effects. Invalidates iterators if reallocation is needed.

    Requires: T shall be MoveInsertable into *this.

    Complexity: Linear in the size of *this.

    Exceptions: Strong exception guarantee.

    Throws: length_error if new_capacity > max_size().

  53.  ( new_capacity);

    Effects: Ensures that n elements can be pushed to the back without requiring reallocation, where n is new_capacity - size(), if n is positive. Otherwise, there are no effects. Invalidates iterators if reallocation is needed.

    Requires: T shall be MoveInsertable into *this.

    Complexity: Linear in the size of *this.

    Exceptions: Strong exception guarantee.

    Throws: length_error if new_capacity > max_size().

  54.  ();

    Effects: Reduces capacity() to size(). Invalidates iterators.

    Requires: T shall be MoveInsertable into *this.

    Exceptions: Strong exception guarantee.

    Complexity: Linear in the size of *this.

  55.  ( n) ;

    Returns: A reference to the nth element in the devector.

    Precondition: n < size().

    Complexity: Constant.

  56.  ( n) ;

    Returns: A constant reference to the nth element in the devector.

    Precondition: n < size().

    Complexity: Constant.

  57.  ( n) ;

    Requires: size() >= n.

    Effects: Returns an iterator to the nth element from the beginning of the container. Returns end() if n == size().

    Throws: Nothing.

    Complexity: Constant.

    Note: Non-standard extension

  58.  ( n) ;

    Requires: size() >= n.

    Effects: Returns a const_iterator to the nth element from the beginning of the container. Returns end() if n == size().

    Throws: Nothing.

    Complexity: Constant.

    Note: Non-standard extension

  59.  ( p) ;

    Requires: begin() <= p <= end().

    Effects: Returns the index of the element pointed by p and size() if p == end().

    Throws: Nothing.

    Complexity: Constant.

    Note: Non-standard extension

  60.  ( p) ;

    Requires: begin() <= p <= end().

    Effects: Returns the index of the element pointed by p and size() if p == end().

    Throws: Nothing.

    Complexity: Constant.

    Note: Non-standard extension

  61.  ( n);

    Returns: A reference to the nth element in the devector.

    Throws: out_of_range, if n >= size().

    Complexity: Constant.

  62.  ( n) ;

    Returns: A constant reference to the nth element in the devector.

    Throws: out_of_range, if n >= size().

    Complexity: Constant.

  63.  () ;

    Returns: A reference to the first element in the devector.

    Precondition: !empty().

    Complexity: Constant.

  64.  () ;

    Returns: A constant reference to the first element in the devector.

    Precondition: !empty().

    Complexity: Constant.

  65.  () ;

    Returns: A reference to the last element in the devector.

    Precondition: !empty().

    Complexity: Constant.

  66.  () ;

    Returns: A constant reference to the last element in the devector.

    Precondition: !empty().

    Complexity: Constant.

  67.  () ;

    Returns: A pointer to the underlying array serving as element storage. The range [data(); data() + size()) is always valid. For a non-empty devector, data() == &front().

    Complexity: Constant.

  68.  () ;

    Returns: A constant pointer to the underlying array serving as element storage. The range [data(); data() + size()) is always valid. For a non-empty devector, data() == &front().

    Complexity: Constant.

  69. template< Args>  ( args);

    Effects: Pushes a new element to the front of the devector. The element is constructed in-place, using the perfect forwarded args as constructor arguments. Invalidates iterators if reallocation is needed. (front_free_capacity() == 0)

    Requires: T shall be EmplaceConstructible from args and MoveInsertable into *this.

    Exceptions: Strong exception guarantee.

    Complexity: Amortized constant in the size of *this. (Constant, if front_free_capacity() > 0)

  70.  ( x);

    Effects: Pushes the copy of x to the front of the devector. Invalidates iterators if reallocation is needed. (front_free_capacity() == 0)

    Requires: T shall be CopyInsertable into *this.

    Exceptions: Strong exception guarantee.

    Complexity: Amortized constant in the size of *this. (Constant, if front_free_capacity() > 0)

  71.  ( x);

    Effects: Move constructs a new element at the front of the devector using x. Invalidates iterators if reallocation is needed. (front_free_capacity() == 0)

    Requires: T shall be MoveInsertable into *this.

    Exceptions: Strong exception guarantee, not regarding the state of x.

    Complexity: Amortized constant in the size of *this. (Constant, if front_free_capacity() > 0)

  72.  () ;

    Effects: Removes the first element of *this.

    Precondition: !empty().

    Postcondition: front_free_capacity() is incremented by 1.

    Complexity: Constant.

  73. template< Args>  ( args);

    Effects: Pushes a new element to the back of the devector. The element is constructed in-place, using the perfect forwarded args as constructor arguments. Invalidates iterators if reallocation is needed. (back_free_capacity() == 0)

    Requires: T shall be EmplaceConstructible from args and MoveInsertable into *this, and MoveAssignable.

    Exceptions: Strong exception guarantee.

    Complexity: Amortized constant in the size of *this. (Constant, if back_free_capacity() > 0)

  74.  ( x);
    defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)

    Effects: Pushes the copy of x to the back of the devector. Invalidates iterators if reallocation is needed. (back_free_capacity() == 0)

    Requires: T shall be CopyInsertable into *this.

    Exceptions: Strong exception guarantee.

    Complexity: Amortized constant in the size of *this. (Constant, if back_free_capacity() > 0)

  75.  ( x);

    Effects: Move constructs a new element at the back of the devector using x. Invalidates iterators if reallocation is needed. (back_free_capacity() == 0)

    Requires: T shall be MoveInsertable into *this.

    Exceptions: Strong exception guarantee, not regarding the state of x.

    Complexity: Amortized constant in the size of *this. (Constant, if back_free_capacity() > 0)

  76.  () ;

    Effects: Removes the last element of *this.

    Precondition: !empty().

    Postcondition: back_free_capacity() is incremented by 1.

    Complexity: Constant.

  77. template< Args> 
       ( position,  args);

    Effects: Constructs a new element before the element pointed by position. The element is constructed in-place, using the perfect forwarded args as constructor arguments. Invalidates iterators if reallocation is needed.

    Requires: T shall be EmplaceConstructible, and MoveInsertable into *this, and MoveAssignable.

    Returns: Iterator pointing to the newly constructed element.

    Exceptions: Strong exception guarantee if T is NothrowConstructible and NothrowAssignable, Basic exception guarantee otherwise.

    Complexity: Linear in the size of *this.

  78.  ( position,  x);
    defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)

    Effects: Copy constructs a new element before the element pointed by position, using x as constructor argument. Invalidates iterators if reallocation is needed.

    Requires: T shall be CopyInsertable into *this and and CopyAssignable.

    Returns: Iterator pointing to the newly constructed element.

    Exceptions: Strong exception guarantee if T is NothrowConstructible and NothrowAssignable, Basic exception guarantee otherwise.

    Complexity: Linear in the size of *this.

  79.  ( position,  x);

    Effects: Move constructs a new element before the element pointed by position, using x as constructor argument. Invalidates iterators if reallocation is needed.

    Requires: T shall be MoveInsertable into *this and and CopyAssignable.

    Returns: Iterator pointing to the newly constructed element.

    Exceptions: Strong exception guarantee if T is NothrowConstructible and NothrowAssignable (not regarding the state of x), Basic exception guarantee otherwise.

    Complexity: Linear in the size of *this.

  80.  ( position,  n,  x);

    Effects: Copy constructs n elements before the element pointed by position, using x as constructor argument. Invalidates iterators if reallocation is needed.

    Requires: T shall be CopyInsertable into *this and and CopyAssignable.

    Returns: Iterator pointing to the first inserted element, or position, if n is zero.

    Exceptions: Strong exception guarantee if T is NothrowConstructible and NothrowAssignable, Basic exception guarantee otherwise.

    Complexity: Linear in the size of *this and n.

  81. template<typename InputIterator> 
       ( position,  first, 
                       BOOST_CONTAINER_DOCIGN);

    Effects: Copy constructs elements before the element pointed by position using each element in the range pointed by first and last as constructor arguments. Invalidates iterators if reallocation is needed.

    Requires: T shall be EmplaceConstructible into *this from *first. If the specified iterator does not meet the forward iterator requirements, T shall also be MoveInsertable into *this and MoveAssignable.

    Precondition: first and last are not iterators into *this.

    Returns: Iterator pointing to the first inserted element, or position, if first == last.

    Complexity: Linear in the size of *this and N (where N is the distance between first and last). Makes only N calls to the constructor of T and no reallocations if iterators first and last are of forward, bidirectional, or random access categories. It makes 2N calls to the copy constructor of T and `O(log(N)) reallocations if they are just input iterators.

    Exceptions: Strong exception guarantee if T is NothrowConstructible and NothrowAssignable, Basic exception guarantee otherwise.

    Remarks: Each iterator in the range [first,last) shall be dereferenced exactly once, unless an exception is thrown.

  82.  ( position,  il);

    Equivalent to: insert(position, il.begin(), il.end())

  83.  ( position);

    Effects: Destroys the element pointed by position and removes it from the devector. Invalidates iterators.

    Requires: T shall be MoveAssignable.

    Precondition: position must be in the range of [begin(), end()).

    Returns: Iterator pointing to the element immediately following the erased element prior to its erasure. If no such element exists, end() is returned.

    Exceptions: Strong exception guarantee if T is NothrowAssignable, Basic exception guarantee otherwise.

    Complexity: Linear in half the size of *this.

  84.  ( first,  last);

    Effects: Destroys the range [first,last) and removes it from the devector. Invalidates iterators.

    Requires: T shall be MoveAssignable.

    Precondition: [first,last) must be in the range of [begin(), end()).

    Returns: Iterator pointing to the element pointed to by last prior to any elements being erased. If no such element exists, end() is returned.

    Exceptions: Strong exception guarantee if T is NothrowAssignable, Basic exception guarantee otherwise.

    Complexity: Linear in half the size of *this plus the distance between first and last.

  85.  ( first,  last);

    Effects: Destroys the range [first,last) and removes it from the devector. Invalidates iterators.

    Requires: T shall be MoveAssignable.

    Precondition: [first,last) must be in the range of [begin(), end()).

    Returns: Iterator pointing to the element pointed to by last prior to any elements being erased. If no such element exists, end() is returned.

    Exceptions: Strong exception guarantee if T is NothrowAssignable, Basic exception guarantee otherwise.

    Complexity: Linear in half the size of *this.

  86.  (devector & b) ;

    Effects: exchanges the contents of *this and b.

    Requires: instances of T must be swappable by unqualified call of swap and T must be MoveInsertable into *this.

    Precondition: The allocators should allow propagation or should compare equal.

    Exceptions: Basic exceptions guarantee if not noexcept.

    Complexity: Constant.

  87.  () ;

    Effects: Destroys all elements in the devector. Invalidates all references, pointers and iterators to the elements of the devector.

    Postcondition: empty() && front_free_capacity() == 0 && back_free_capacity() == old capacity.

    Complexity: Linear in the size of *this.

    Remarks: Does not free memory.

devector private member functions

  1.  (devector && x, );
  2.  (devector && x, );
  3.  ( i) ;
  4.  ( i) ;
  5.  () ;
  6.  () ;

devector private static functions

  1.  ( i);

PrevUpHomeNext