Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class template seq

boost::segmented_tree::seq

Synopsis

// In header: <boost/segmented_tree/seq.hpp>

template<typename T, typename Allocator, std::size_t segment_target, 
         std::size_t base_target> 
class seq {
public:
  // types
  typedef typename element_traits::value_type                   value_type;              // The type of elements stored in the container. 
  typedef Allocator                                             allocator_type;          // The allocator type used by the container. 
  typedef typename element_traits::size_type                    size_type;               // The unsigned integral type used by the container. 
  typedef typename element_traits::difference_type              difference_type;         // The pointers difference type. 
  typedef value_type &                                          reference;               // The value reference type. 
  typedef value_type const &                                    const_reference;         // The value const reference type. 
  typedef typename element_traits::pointer                      pointer;                 // The pointer type. 
  typedef typename element_traits::const_pointer                const_pointer;           // The const pointer type. 
  typedef iterator_t< static_traits, pointer, T & >             iterator;                // The iterator type. 
  typedef iterator_t< static_traits, const_pointer, T const & > const_iterator;          // The const iterator type. 
  typedef std::reverse_iterator< iterator >                     reverse_iterator;        // The reverse iterator type. 
  typedef std::reverse_iterator< const_iterator >               const_reverse_iterator;  // The const reverse iterator. 

  // construct/copy/destruct
  explicit seq() noexcept( std::is_nothrow_default_constructible< allocator_type >::value));
  explicit seq(Allocator const &);
  seq(size_type, T const &, Allocator const & = Allocator());
  explicit seq(size_type, Allocator const & = Allocator());
  template<typename InputIt, 
           typename  = typename std::iterator_traits<InputIt>::pointer> 
    seq(InputIt, InputIt, Allocator const & = Allocator());
  seq(seq const &);
  seq(seq const &, Allocator const &);
  seq(seq &&) noexcept( std::is_nothrow_move_constructible< allocator_type >::value));
  seq(seq &&, Allocator const &);
  seq(std::initializer_list< T >, Allocator const & = Allocator());
  seq & operator=(seq const &);
  seq & operator=(seq &&) noexcept( element_traits::propagate_on_container_move_assignment::value &&std::is_nothrow_move_assignable< allocator_type >::value));
  seq & operator=(std::initializer_list< T >);
  ~seq();

  // public member functions
  void assign(size_type, T const &);
  template<typename InputIt, 
           typename  = typename std::iterator_traits<InputIt>::pointer> 
    void assign(InputIt, InputIt);
  void assign(std::initializer_list< T >);
  allocator_type get_allocator() const noexcept;
  reference at(size_type);
  const_reference at(size_type) const;
  reference operator[](size_type);
  const_reference operator[](size_type) const;
  reference front();
  const_reference front() const;
  reference back();
  const_reference back() const;
  iterator begin() noexcept;
  const_iterator begin() const noexcept;
  const_iterator cbegin() const noexcept;
  iterator penultimate() noexcept;
  const_iterator penultimate() const noexcept;
  const_iterator cpenultimate() const noexcept;
  iterator end() noexcept;
  const_iterator end() const noexcept;
  const_iterator cend() const noexcept;
  reverse_iterator rbegin() noexcept;
  const_reverse_iterator rbegin() const noexcept;
  const_reverse_iterator crbegin() const noexcept;
  reverse_iterator rend() noexcept;
  const_reverse_iterator rend() const noexcept;
  const_reverse_iterator crend() const noexcept;
  iterator nth(size_type) noexcept;
  const_iterator nth(size_type) const noexcept;
  size_type index_of(iterator) noexcept;
  size_type index_of(const_iterator) const noexcept;
  bool empty() const noexcept;
  size_type size() const noexcept;
  size_type height() const noexcept;
  size_type max_size() const noexcept;
  void clear() noexcept;
  iterator insert(const_iterator, T const &);
  iterator insert(const_iterator, T &&);
  iterator insert(const_iterator, size_type, T const &);
  template<typename InputIt, 
           typename  = typename std::iterator_traits<InputIt>::pointer> 
    iterator insert(const_iterator, InputIt, InputIt);
  iterator insert(const_iterator, std::initializer_list< T >);
  template<class... Args> iterator emplace(const_iterator, Args &&...);
  iterator erase(const_iterator);
  iterator erase(const_iterator, const_iterator);
  void push_back(T const &);
  void push_back(T &&);
  template<class... Args> void emplace_back(Args &&...);
  void pop_back();
  void push_front(const T &);
  void push_front(T &&);
  template<class... Args> void emplace_front(Args &&...);
  void pop_front();
  void resize(size_type);
  void resize(size_type, value_type const &);
  void swap(seq &) noexcept( !element_traits::propagate_on_container_swap::value|| detail::is_nothrow_swappable< allocator_type >::value));
  void merge(seq &);
  void merge(seq &&);
  template<typename Compare> void merge(seq &, Compare);
  template<typename Compare> void merge(seq &&, Compare);
  void splice(const_iterator, seq &);
  void splice(const_iterator, seq &&);
  void splice(const_iterator, seq &, const_iterator);
  void splice(const_iterator, seq &&, const_iterator);
  void splice(const_iterator, seq &, const_iterator, const_iterator);
  void splice(const_iterator, seq &&, const_iterator, const_iterator);
  void remove(const T &);
  template<typename UnaryPredicate> void remove_if(UnaryPredicate);
  void reverse();
  void unique();
  template<typename BinaryPredicate> void unique(BinaryPredicate);
  void sort();
  template<typename Compare> void sort(Compare);

  // friend functions
  friend bool operator==(seq const &, seq const &);
  friend bool operator!=(seq const &, seq const &);
  friend bool operator<(seq const &, seq const &);
  friend bool operator<=(seq const &, seq const &);
  friend bool operator>(seq const &, seq const &);
  friend bool operator>=(seq const &, seq const &);
  friend void swap(seq &, seq &) noexcept(noexcept(a.swap(b))));
};

Description

A seq is a sequence container that provides efficient random access insert and erase.

Template Parameters

  1. typename T

    The type of the element to be stored

  2. typename Allocator

    The type of the allocator used for all memory management

  3. std::size_t segment_target

    The size in bytes to try to use for element nodes

  4. std::size_t base_target

    The size in bytes to try to use for index nodes

seq public construct/copy/destruct

  1. explicit seq() noexcept( std::is_nothrow_default_constructible< allocator_type >::value));

    Effects. Default constructs an empty sequence.

    Complexity. Constant.

  2. explicit seq(Allocator const & alloc);

    Effects. Constructs an empty sequence using the specified allocator.

    Complexity. Constant.

  3. seq(size_type count, T const & value, Allocator const & alloc = Allocator());

    Effects. Constructs a count size sequence using the specified allocator, each element copy constructed from value.

    Complexity. NlogN, where N is count.

  4. explicit seq(size_type count, Allocator const & alloc = Allocator());

    Effects. Constructs a count size sequence using the specified allocator, each element default constructed.

    Complexity. NlogN, where N is count.

  5. template<typename InputIt, 
             typename  = typename std::iterator_traits<InputIt>::pointer> 
      seq(InputIt first, InputIt last, Allocator const & alloc = Allocator());

    Effects. Constructs an empty sequence using the specified allocator, and inserts elements from the range [first, last).

    Complexity. NlogN, where N is the size of the range.

  6. seq(seq const & other);

    Effects. Copy constructs a sequence.

    Complexity. NlogN, where N is other.size().

  7. seq(seq const & other, Allocator const & alloc);

    Effects. Copy constructs a sequence using the specified allocator.

    Complexity. NlogN, where N is other.size().

  8. seq(seq && other) noexcept( std::is_nothrow_move_constructible< allocator_type >::value));

    Effects. Move constructs a sequence.

    Complexity. Constant.

  9. seq(seq && other, Allocator const & alloc);

    Effects. Move constructs a sequence using the specified allocator.

    Complexity. Constant if alloc compares equal to other's allocator. NlogN, where N is other.size() otherwise.

  10. seq(std::initializer_list< T > init, Allocator const & alloc = Allocator());

    Effects. Constructs an empty sequence using the specified allocator, and inserts elements from init.

    Complexity. NlogN, where N is init.size().

  11. seq & operator=(seq const & other);

    Effects. Copy assigns a sequence.

    Returns. A reference to *this.

    Complexity. Linear in the minimum of size() and other.size(), plus MlogN, where M is the difference of size() and other.size(), and N is the maximum of size() and other.size().

    Iterator invalidation. Invalidates all iterators.

    Exception safety. Basic.

  12. seq & operator=(seq && other) noexcept( element_traits::propagate_on_container_move_assignment::value &&std::is_nothrow_move_assignable< allocator_type >::value));

    Effects. Move assigns a sequence.

    Returns. A reference to *this.

    Complexity. Linear in size() if the allocator propagates on move assignment or the sequence's allocator compares equal to other's allocator. Linear in the minimum of size() and other.size(), plus MlogN, where M is the difference of size() and other.size(), and N is the maximum of size() and other.size() otherwise.

    Iterator invalidation. No iterators are invalidated if the allocator propagates on move assignment or the sequence's allocator compares equal to other's allocator. Invalidates all iterators otherwise.

    Exception safety. No-throw if the allocator propagates on move assignment or the sequence's allocator compares equal to other's allocator. Basic otherwise.

  13. seq & operator=(std::initializer_list< T > ilist);

    Effects. Assigns the sequence to count elements copy constructed from value.

    Returns. A reference to *this.

    Complexity. Linear in the minimum of size() and ilist.size(), plus MlogN, where M is the difference of size() and ilist.size(), and N is the maximum of size() and ilist.size().

    Iterator invalidation. Invalidates all iterators.

    Exception safety. Basic.

  14. ~seq();

    Effects. Destructs the sequence releasing all memory.

    Complexity. Linear in size().

seq public member functions

  1. void assign(size_type count, T const & value);

    Effects. Assigns the sequence to count elements copy constructed from value.

    Complexity. Linear in the minimum of size() and count, plus MlogN, where M is the difference of size() and count, and N is the maximum of size() and count.

    Iterator invalidation. Invalidates all iterators.

    Exception safety. Basic.

  2. template<typename InputIt, 
             typename  = typename std::iterator_traits<InputIt>::pointer> 
      void assign(InputIt first, InputIt last);

    Effects. Assigns the sequence to the elements copy constructed from the range [first, last).

    Complexity. Linear in the minimum of size() and the size of the range, plus MlogN, where M is the difference of size() and the size of the range, and N is the maximum of size() and the size of the range.

    Iterator invalidation. Invalidates all iterators.

    Exception safety. Basic.

  3. void assign(std::initializer_list< T > ilist);

    Effects. Assigns the sequence to the elements of the specified initializer_list.

    Complexity. Linear in the minimum of size() and ilist.size(), plus MlogN, where M is the difference of size() and ilist.size(), and N is the maximum of size() and ilist.size().

    Iterator invalidation. Invalidates all iterators.

    Exception safety. Basic.

  4. allocator_type get_allocator() const noexcept;

    Returns. A copy of the allocator for the sequence.

    Complexity. Constant.

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. No-throw.

  5. reference at(size_type pos);

    Returns. A reference for the element located at the index pos.

    Complexity. Logarithmic in size().

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. Strong.

  6. const_reference at(size_type pos) const;

    Returns. A const_reference for the element located at the specified index pos.

    Complexity. Logarithmic in size().

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. Strong.

  7. reference operator[](size_type pos);

    Returns. A reference for the element located at the specified index pos.

    Complexity. Logarithmic in size().

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. Strong.

  8. const_reference operator[](size_type pos) const;

    Returns. A const_reference for the element located at the specified index pos.

    Complexity. Logarithmic in size().

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. Strong.

  9. reference front();

    Returns. A reference for the element located at the index 0.

    Complexity. Logarithmic in size().

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. Strong.

  10. const_reference front() const;

    Returns. A const_reference for the element located at the index 0.

    Complexity. Logarithmic in size().

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. Strong.

  11. reference back();

    Returns. A reference for the element located at the index size() - 1.

    Complexity. Logarithmic in size().

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. Strong.

  12. const_reference back() const;

    Returns. A const_reference for the element located at the index size() - 1.

    Complexity. Logarithmic in size().

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. Strong.

  13. iterator begin() noexcept;

    Returns. An iterator for the index 0.

    Complexity. Logarithmic in size().

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. No-throw.

  14. const_iterator begin() const noexcept;

    Returns. A const_iterator for the index 0.

    Complexity. Logarithmic in size().

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. No-throw.

  15. const_iterator cbegin() const noexcept;

    Returns. A const_iterator for the index 0.

    Complexity. Logarithmic in size().

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. No-throw.

  16. iterator penultimate() noexcept;

    Returns. An iterator to the index size() - 1

    Complexity. Logarithmic in size().

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. No-throw.

    Note. Non-standard extension.

  17. const_iterator penultimate() const noexcept;

    Returns. A const_iterator to the index size() - 1

    Complexity. Logarithmic in size().

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. No-throw.

    Note. Non-standard extension.

  18. const_iterator cpenultimate() const noexcept;

    Returns. A const_iterator to the index size() - 1

    Complexity. Logarithmic in size().

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. No-throw.

    Note. Non-standard extension.

  19. iterator end() noexcept;

    Returns. An iterator for the index size().

    Complexity. Logarithmic in size().

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. No-throw.

  20. const_iterator end() const noexcept;

    Returns. A const_iterator for the index size().

    Complexity. Logarithmic in size().

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. No-throw.

  21. const_iterator cend() const noexcept;

    Returns. A const_iterator for the index size().

    Complexity. Logarithmic in size().

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. No-throw.

  22. reverse_iterator rbegin() noexcept;

    Returns. A reverse_iterator for the index size().

    Complexity. Logarithmic in size().

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. No-throw.

  23. const_reverse_iterator rbegin() const noexcept;

    Returns. A const_reverse_iterator for the index size().

    Complexity. Logarithmic in size().

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. No-throw.

  24. const_reverse_iterator crbegin() const noexcept;

    Returns. A const_reverse_iterator for the index size().

    Complexity. Logarithmic in size().

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. No-throw.

  25. reverse_iterator rend() noexcept;

    Returns. A reverse_iterator for the index 0.

    Complexity. Logarithmic in size().

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. No-throw.

  26. const_reverse_iterator rend() const noexcept;

    Returns. A const_reverse_iterator for the index 0.

    Complexity. Logarithmic in size().

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. No-throw.

  27. const_reverse_iterator crend() const noexcept;

    Returns. A const_reverse_iterator for the index 0.

    Complexity. Logarithmic in size().

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. No-throw.

  28. iterator nth(size_type pos) noexcept;

    Returns. An iterator for the index pos.

    Complexity. Logarithmic in size().

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. No-throw.

    Note. Non-standard extension.

    Note. This member function is more efficient than calling begin() and advancing.

  29. const_iterator nth(size_type pos) const noexcept;

    Returns. A const_iterator for the index pos.

    Complexity. Logarithmic in size().

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. No-throw.

    Note. Non-standard extension.

    Note. This member function is more efficient than calling begin() and advancing.

  30. size_type index_of(iterator pos) noexcept;

    Returns. The index of the specified iterator.

    Complexity. Constant.

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. No-throw.

    Note. Non-standard extension.

  31. size_type index_of(const_iterator pos) const noexcept;

    Returns. The index of the specified const_iterator.

    Complexity. Constant.

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. No-throw.

    Note. Non-standard extension.

  32. bool empty() const noexcept;

    Returns. True if the sequence is empty. False otherwise.

    Complexity. Constant.

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. No-throw.

  33. size_type size() const noexcept;

    Returns. The count of elements stored in the sequence.

    Complexity. Constant.

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. No-throw.

  34. size_type height() const noexcept;

    Returns. The height of the tree.

    Complexity. Constant.

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. No-throw.

    Note. Non-standard extension.

  35. size_type max_size() const noexcept;

    Returns. The maximum count of elements able to be stored in the sequence.

    Complexity. Constant.

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. No-throw.

  36. void clear() noexcept;

    Effects. Removes all elements from the sequence.

    Complexity. Linear in size().

    Iterator invalidation. Invalidates all iterators.

    Exception safety. No-throw.

  37. iterator insert(const_iterator pos, T const & value);

    Effects. Copy constructs an element at the specified position.

    Returns. An iterator to the inserted element.

    Complexity. Logarithmic in size().

    Iterator invalidation. Invalidates all iterators.

    Exception safety. Strong.

  38. iterator insert(const_iterator pos, T && value);

    Effects. Move constructs an element at the specified position.

    Returns. An iterator to the inserted element.

    Complexity. Logarithmic in size().

    Iterator invalidation. Invalidates all iterators.

    Exception safety. Strong.

  39. iterator insert(const_iterator pos, size_type count, T const & value);

    Effects. Copy constructs count elements at the specified position.

    Returns. An iterator to the first inserted element if count != 0. A copy of pos otherwise.

    Complexity. MlogN, where M is count, and N is the maximum of size() and count.

    Iterator invalidation. Invalidates all iterators.

    Exception safety. Basic.

  40. template<typename InputIt, 
             typename  = typename std::iterator_traits<InputIt>::pointer> 
      iterator insert(const_iterator pos, InputIt first, InputIt last);

    Effects. Copy constructs all elements in the range [first, last) at the specified position.

    Returns. An iterator to the first inserted element if first != last. A copy of pos otherwise.

    Complexity. MlogN, where M is the size of the range, and N is the maximum of size() and the size of the range.

    Iterator invalidation. Invalidates all iterators.

    Exception safety. Basic.

  41. iterator insert(const_iterator pos, std::initializer_list< T > ilist);

    Effects. Copy constructs all elements in the specified initializer_list at the specified position.

    Returns. An iterator to the first inserted element if ilist.size() != 0. A copy of pos otherwise.

    Complexity. MlogN, where M is ilist.size(), and N is the maximum of size() and ilist.size().

    Iterator invalidation. Invalidates all iterators.

    Exception safety. Basic.

  42. template<class... Args> iterator emplace(const_iterator pos, Args &&... args);

    Effects. Forward constructs an element at the specified position.

    Returns. An iterator to the inserted element.

    Complexity. Logarithmic in size().

    Iterator invalidation. Invalidates all iterators.

    Exception safety. Strong.

  43. iterator erase(const_iterator pos);

    Effects. Remove the element at the specified position from the sequence.

    Returns. An iterator to the element following the removed element.

    Complexity. Logarithmic in size().

    Iterator invalidation. Invalidates all iterators.

    Exception safety. Strong.

  44. iterator erase(const_iterator first, const_iterator last);

    Effects. Remove all elements in the range [first, last) from the sequence.

    Returns. An iterator to the element following the last removed element.

    Complexity. MlogN, where M is the size of the range, and N is size().

    Iterator invalidation. Invalidates all iterators.

    Exception safety. Basic.

  45. void push_back(T const & value);

    Effects. Copy constructs an element at end().

    Complexity. Logarithmic in size().

    Iterator invalidation. Invalidates all iterators.

    Exception safety. Strong.

  46. void push_back(T && value);

    Effects. Move constructs an element at end().

    Complexity. Logarithmic in size().

    Iterator invalidation. Invalidates all iterators.

    Exception safety. Strong.

  47. template<class... Args> void emplace_back(Args &&... args);

    Effects. Forward constructs an element at end().

    Complexity. Logarithmic in size().

    Iterator invalidation. Invalidates all iterators.

    Exception safety. Strong.

  48. void pop_back();

    Effects. Removes the element at end() - 1.

    Complexity. Logarithmic in size().

    Iterator invalidation. Invalidates all iterators.

    Exception safety. Strong.

  49. void push_front(const T & value);

    Effects. Copy constructs an element at begin().

    Complexity. Logarithmic in size().

    Iterator invalidation. Invalidates all iterators.

    Exception safety. Strong.

  50. void push_front(T && value);

    Effects. Move constructs an element at begin().

    Complexity. Logarithmic in size().

    Iterator invalidation. Invalidates all iterators.

    Exception safety. Strong.

  51. template<class... Args> void emplace_front(Args &&... args);

    Effects. Forward constructs an element at begin().

    Complexity. Logarithmic in size().

    Iterator invalidation. Invalidates all iterators.

    Exception safety. Strong.

  52. void pop_front();

    Effects. Removes the element at begin().

    Complexity. Logarithmic in size().

    Iterator invalidation. Invalidates all iterators.

    Exception safety. Strong.

  53. void resize(size_type count);

    Effects. Resizes the seqeuence to the specified size, default constructing any elements above the current size.

    Complexity. MlogN, where M is the difference of size() and count, and N is the max of size() and count.

    Iterator invalidation. Invalidates all iterators.

    Exception safety. Strong.

  54. void resize(size_type count, value_type const & value);

    Effects. Resizes the seqeuence to the specified size, copy constructing any elements from value above the current size.

    Complexity. MlogN, where M is the difference of size() and count, and N is the max of size() and count.

    Iterator invalidation. Invalidates all iterators.

    Exception safety. Basic.

  55. void swap(seq & other) noexcept( !element_traits::propagate_on_container_swap::value|| detail::is_nothrow_swappable< allocator_type >::value));

    Effects. Swaps the contents *this with the specified sequence.

    Complexity. Constant.

    Iterator invalidation. Every iterator referring to an element in one container before the swap shall refer to the same element in the other container after the swap.

    Exception safety. No-throw if the allocator propagates on swap or the allocator doesn't throw on swap. Strong otherwise.

  56. void merge(seq & other);

    Effects. Transfers all elements in the sorted other into the sorted *this so that all elements are in stable sorted order.

    Complexity. Linear in size() + other.size() if enough temporary memory is available. NlogN, where N is the maximum of size() and other.size() otherwise.

    Iterator invalidation. Invalidates all iterators in *this and other.

    Exception safety. Basic.

  57. void merge(seq && other);

    Effects. Transfers all elements in the sorted other into the sorted *this so that all elements are in stable sorted order.

    Complexity. Linear in size() + other.size() if enough temporary memory is available. NlogN, where N is the maximum of size() and other.size() otherwise.

    Iterator invalidation. Invalidates all iterators in *this and other.

    Exception safety. Basic.

  58. template<typename Compare> void merge(seq & other, Compare comp);

    Effects. Transfers all elements in the sorted other into the sorted *this so that all elements are in stable sorted order using the specified compare functor.

    Complexity. Linear in size() + other.size() if enough temporary memory is available. NlogN, where N is the maximum of size() and other.size() otherwise.

    Iterator invalidation. Invalidates all iterators in *this and other.

    Exception safety. Basic.

  59. template<typename Compare> void merge(seq && other, Compare comp);

    Effects. Transfers all elements in the sorted other into the sorted *this so that all elements are in stable sorted order using the specified compare functor.

    Complexity. Linear in size() + other.size() if enough temporary memory is available. NlogN, where N is the maximum of size() and other.size() otherwise.

    Iterator invalidation. Invalidates all iterators in *this and other.

    Exception safety. Basic.

  60. void splice(const_iterator pos, seq & other);

    Effects. Transfers all elements in other to the specified position.

    Complexity. MlogN, where M is other.size(), and N is the maximum of size(), and other.size().

    Iterator invalidation. Invalidates all iterators in *this and other.

    Exception safety. Basic.

  61. void splice(const_iterator pos, seq && other);

    Effects. Transfers all elements in other to the specified position.

    Complexity. MlogN, where M is other.size(), and N is the maximum of size(), and other.size().

    Iterator invalidation. Invalidates all iterators in *this and other.

    Exception safety. Basic.

  62. void splice(const_iterator pos, seq & other, const_iterator it);

    Effects. Transfers the element pointer to by it to the specified position.

    Complexity. Logarithmic in the maximum of size() and other.size().

    Iterator invalidation. Invalidates all iterators in *this and other.

    Exception safety. Basic.

  63. void splice(const_iterator pos, seq && other, const_iterator it);

    Effects. Transfers the element pointer to by it to the specified position.

    Complexity. Logarithmic in the maximum of size() and other.size().

    Iterator invalidation. Invalidates all iterators in *this and other.

    Exception safety. Basic.

  64. void splice(const_iterator pos, seq & other, const_iterator first, 
                const_iterator last);

    Effects. Transfers all elements in the range [first, last) to the specified position.

    Complexity. MlogN, where M is the size of the range, and N is the maximum of size(), other.size(), and the size of the range.

    Iterator invalidation. Invalidates all iterators in *this and other.

    Exception safety. Basic.

  65. void splice(const_iterator pos, seq && other, const_iterator first, 
                const_iterator last);

    Effects. Transfers all elements in the range [first, last) to the specified position.

    Complexity. MlogN, where M is the size of the range, and N is the maximum of size(), other.size(), and the size of the range.

    Iterator invalidation. Invalidates all iterators in *this and other.

    Exception safety. Basic.

  66. void remove(const T & value);

    Effects. Removes all elements matching the specified value.

    Complexity. Logarithmic in size().

    Iterator invalidation. Invalidates all iterators.

    Exception safety. Basic.

  67. template<typename UnaryPredicate> void remove_if(UnaryPredicate p);

    Effects. Removes all elements matching the specified predicate.

    Complexity. Linear in size().

    Iterator invalidation. Invalidates all iterators.

    Exception safety. Basic.

  68. void reverse();

    Effects. Reverses the sequence.

    Complexity. Linear in size().

    Iterator invalidation. Iterators are not invalidated, but reflect the change in ordering.

    Exception safety. Basic.

  69. void unique();

    Effects. Removes all consecutive duplicate elements from the sequence.

    Complexity. Linear in size().

    Iterator invalidation. Invalidates all iterators.

    Exception safety. Basic.

  70. template<typename BinaryPredicate> void unique(BinaryPredicate p);

    Effects. Removes all consecutive duplicate elements from the sequence using the specified equality functor.

    Complexity. Linear in size().

    Iterator invalidation. Invalidates all iterators.

    Exception safety. Basic.

  71. void sort();

    Effects. Stable sorts the sequence.

    Complexity. NlogN, where N is size().

    Iterator invalidation. Iterators are not invalidated, but reflect the change in ordering.

    Exception safety. Basic.

  72. template<typename Compare> void sort(Compare comp);

    Effects. Stable sort the sequence using the specified compare functor.

    Complexity. NlogN, where N is size().

    Iterator invalidation. Iterators are not invalidated, but reflect the change in ordering.

    Exception safety. Basic.

seq friend functions

  1. friend bool operator==(seq const & lhs, seq const & rhs);

    Returns. True if both sequences are of the same length and have each element in both sequences are equal. False otherwise.

    Complexity. Linear in size().

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. Strong.

  2. friend bool operator!=(seq const & lhs, seq const & rhs);

    Returns. False if both sequences are of the same length and have each element in both sequences are equal. True otherwise.

    Complexity. Linear in size().

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. Strong.

  3. friend bool operator<(seq const & lhs, seq const & rhs);

    Returns. True if the first sequence is lexicographically less than the second. False otherwise.

    Complexity. Linear in size().

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. Strong.

  4. friend bool operator<=(seq const & lhs, seq const & rhs);

    Returns. True if the first sequence is equal or lexicographically less than the second. False otherwise.

    Complexity. Linear in size().

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. Strong.

  5. friend bool operator>(seq const & lhs, seq const & rhs);

    Returns. True if the first sequence is lexicographically greater than the second. False otherwise.

    Complexity. Linear in size().

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. Strong.

  6. friend bool operator>=(seq const & lhs, seq const & rhs);

    Returns. True if the first sequence is lexicographically greater or equal to the second. False otherwise.

    Complexity. Linear in size().

    Iterator invalidation. Iterators are not invalidated.

    Exception safety. Strong.

  7. friend void swap(seq & a, seq & b) noexcept(noexcept(a.swap(b))));

    Effects. Swaps the contents of the sequences.

    Complexity. Constant.

    Iterator invalidation. Every iterator referring to an element in one container before the swap shall refer to the same element in the other container after the swap.

    Exception safety. No-throw if the allocator propagates on swap or the allocator doesn't throw on swap. Strong otherwise.


PrevUpHomeNext