void assign(size_type n, const T & val);
Effects: Assigns the n copies of val to *this.
Throws: If memory allocation throws or T's copy constructor throws.
Complexity: Linear to n.
template<typename InpIt> void assign(InpIt first, InpIt last);
Effects: Assigns the range [first, last) to *this.
Throws: If memory allocation throws or T's constructor from dereferencing InpIt throws.
Complexity: Linear to n.
void assign(std::initializer_list< value_type > il);
Effects: Assigns the range [il.begin(), il.end()) to *this.
Throws: If memory allocation throws or T's constructor from dereferencing std::initializer_list iterator throws.
Complexity: Linear to n.
allocator_type get_allocator() const noexcept;
Effects: Returns a copy of the internal allocator.
Throws: If allocator's copy constructor throws.
Complexity: Constant.
stored_allocator_type & get_stored_allocator() noexcept;
Effects: Returns a reference to the internal allocator.
Throws: Nothing
Complexity: Constant.
Note: Non-standard extension.
const stored_allocator_type & get_stored_allocator() const noexcept;
Effects: Returns a reference to the internal allocator.
Throws: Nothing
Complexity: Constant.
Note: Non-standard extension.
Effects: Возвращает итератор первому элементу, содержащемуся в списке.
Throws: Nothing.
комплексность: Постоян.
Effects: Returns an iterator to the first element contained in the list.
Throws: Nothing.
Complexity: Constant.
[ORIG_END] -->const_iterator begin() const noexcept;
Effects: Returns a const_iterator to the first element contained in the list.
Throws: Nothing.
Complexity: Constant.
iterator end() noexcept;
Effects: Returns an iterator to the end of the list.
Throws: Nothing.
Complexity: Constant.
const_iterator end() const noexcept;
Effects: Returns a const_iterator to the end of the list.
Throws: Nothing.
Complexity: Constant.
reverse_iterator rbegin() noexcept;
Effects: Returns a reverse_iterator pointing to the beginning of the reversed list.
Throws: Nothing.
Complexity: Constant.
const_reverse_iterator rbegin() const noexcept;
Effects: Returns a const_reverse_iterator pointing to the beginning of the reversed list.
Throws: Nothing.
Complexity: Constant.
reverse_iterator rend() noexcept;
Effects: Returns a reverse_iterator pointing to the end of the reversed list.
Throws: Nothing.
Complexity: Constant.
const_reverse_iterator rend() const noexcept;
Effects: Returns a const_reverse_iterator pointing to the end of the reversed list.
Throws: Nothing.
Complexity: Constant.
Effects: Description
Throws: Nothing.
комплексность: Постоян.
Effects: Returns a const_iterator to the first element contained in the list.
Throws: Nothing.
Complexity: Constant.
[ORIG_END] -->const_iterator cend() const noexcept;
Effects: Returns a const_iterator to the end of the list.
Throws: Nothing.
Complexity: Constant.
const_reverse_iterator crbegin() const noexcept;
Effects: Returns a const_reverse_iterator pointing to the beginning of the reversed list.
Throws: Nothing.
Complexity: Constant.
const_reverse_iterator crend() const noexcept;
Effects: Returns a const_reverse_iterator pointing to the end of the reversed list.
Throws: Nothing.
Complexity: Constant.
bool empty() const noexcept;
Effects: Returns true if the list contains no elements.
Throws: Nothing.
Complexity: Constant.
size_type size() const noexcept;
Effects: Returns the number of the elements contained in the list.
Throws: Nothing.
Complexity: Constant.
Effects: Возвращает максимально возможный размер списка.
Throws: Nothing.
комплексность: Постоян.
Effects: Returns the largest possible size of the list.
Throws: Nothing.
Complexity: Constant.
[ORIG_END] -->void resize(size_type new_size);
Effects: Inserts or erases elements at the end such that the size becomes n. New elements are value initialized.
Throws: If memory allocation throws, or T's copy constructor throws.
Complexity: Linear to the difference between size() and new_size.
void resize(size_type new_size, const T & x);
Effects: Inserts or erases elements at the end such that the size becomes n. New elements are copy constructed from x.
Throws: If memory allocation throws, or T's copy constructor throws.
Complexity: Linear to the difference between size() and new_size.
reference front() noexcept;
Requires: !empty()
Effects: Returns a reference to the first element from the beginning of the container.
Throws: Nothing.
Complexity: Constant.
Requires: !empty()
Effects: Description
Throws: Nothing.
комплексность: Постоян.
Requires: !empty()
Effects: Returns a const reference to the first element from the beginning of the container.
Throws: Nothing.
Complexity: Constant.
[ORIG_END] -->reference back() noexcept;
Requires: !empty()
Effects: Returns a reference to the first element from the beginning of the container.
Throws: Nothing.
Complexity: Constant.
const_reference back() const noexcept;
Requires: !empty()
Effects: Returns a const reference to the first element from the beginning of the container.
Throws: Nothing.
Complexity: Constant.
template<class... Args> reference emplace_back(Args &&... args);
Effects: Inserts an object of type T constructed with std::forward<Args>(args)... in the end of the list.
Returns: A reference to the created object.
Throws: If memory allocation throws or T's in-place constructor throws.
Complexity: Constant
template<class... Args> reference emplace_front(Args &&... args);
Effects: Inserts an object of type T constructed with std::forward<Args>(args)... in the beginning of the list.
Returns: A reference to the created object.
Throws: If memory allocation throws or T's in-place constructor throws.
Complexity: Constant
Effects: Вставка объекта типа T, построенного с std::forward(args)... перед p.
Throws: Если распределение памяти бросается или T's in-place конструктор бросает.
комплексность: Постоян
Effects: Inserts an object of type T constructed with std::forward<Args>(args)... before p.
Throws: If memory allocation throws or T's in-place constructor throws.
Complexity: Constant
[ORIG_END] -->Effects: Вставляет копию x в начале списка.
Throws: Если выбрасывается распределение памяти или выбрасывается копировальный конструктор T.
комплексность: амортизированная постоянная время.
Effects: Inserts a copy of x at the beginning of the list.
Throws: If memory allocation throws or T's copy constructor throws.
Complexity: Amortized constant time.
[ORIG_END] -->void push_front(T && x);
Effects: Constructs a new element in the beginning of the list and moves the resources of x to this new element.
Throws: If memory allocation throws.
Complexity: Amortized constant time.
void push_back(const T & x);
Effects: Inserts a copy of x at the end of the list.
Throws: If memory allocation throws or T's copy constructor throws.
Complexity: Amortized constant time.
void push_back(T && x);
Effects: Constructs a new element in the end of the list and moves the resources of x to this new element.
Throws: If memory allocation throws.
Complexity: Amortized constant time.
iterator insert(const_iterator p, const T & x);
Requires: p must be a valid iterator of *this.
Effects: Insert a copy of x before p.
Returns: an iterator to the inserted element.
Throws: If memory allocation throws or x's copy constructor throws.
Complexity: Amortized constant time.
Requires: p должно быть действительным итератором *это.
Effects: Включить новый элемент перед p с ресурсами x.
Возвращения: итератор к вставленному элементу.
Throws: Если выбрасывается распределение памяти.
комплексность: амортизированная постоянная время.
Requires: p must be a valid iterator of *this.
Effects: Insert a new element before p with x's resources.
Returns: an iterator to the inserted element.
Throws: If memory allocation throws.
Complexity: Amortized constant time.
[ORIG_END] -->iterator insert(const_iterator position, size_type n, const T & x);
Requires: p must be a valid iterator of *this.
Effects: Inserts n copies of x before p.
Returns: an iterator to the first inserted element or p if n is 0.
Throws: If memory allocation throws or T's copy constructor throws.
Complexity: Linear to n.
template<typename InpIt>
iterator insert(const_iterator p, InpIt first, InpIt last);
Requires: p must be a valid iterator of *this.
Effects: Insert a copy of the [first, last) range before p.
Returns: an iterator to the first inserted element or p if first == last.
Throws: If memory allocation throws, T's constructor from a dereferenced InpIt throws.
Complexity: Linear to distance [first, last).
iterator insert(const_iterator p, std::initializer_list< value_type > il);
Requires: p must be a valid iterator of *this.
Effects: Insert a copy of the [il.begin(), il.end()) range before p.
Returns: an iterator to the first inserted element or p if if.begin() == il.end().
Throws: If memory allocation throws, T's constructor from a dereferenced std::initializer_list iterator throws.
Complexity: Linear to distance [il.begin(), il.end()).
void pop_front() noexcept;
Effects: Removes the first element from the list.
Throws: Nothing.
Complexity: Amortized constant time.
void pop_back() noexcept;
Effects: Removes the last element from the list.
Throws: Nothing.
Complexity: Amortized constant time.
Requires: p должно быть действительным итератором *это.
Effects: Erases элемент на p.
Throws: Nothing.
комплексность: амортизированная постоянная время.
Requires: p must be a valid iterator of *this.
Effects: Erases the element at p.
Throws: Nothing.
Complexity: Amortized constant time.
[ORIG_END] -->iterator erase(const_iterator first, const_iterator last) noexcept;
Requires: first and last must be valid iterator to elements in *this.
Effects: Erases the elements pointed by [first, last).
Throws: Nothing.
Complexity: Linear to the distance between first and last.
void swap(list & x) noexcept(allocator_traits_type::propagate_on_container_swap::value||allocator_traits_type::is_always_equal::value));
Effects: Swaps the contents of *this and x.
Throws: Nothing.
Complexity: Constant.
void clear() noexcept;
Effects: Erases all the elements of the list.
Throws: Nothing.
Complexity: Linear to the number of elements in the list.
void splice(const_iterator p, list & x) noexcept;
Requires: p must point to an element contained by the list. x != *this. this' allocator and x's allocator shall compare equal
Effects: Transfers all the elements of list x to this list, before the the element pointed by p. No destructors or copy constructors are called.
Throws: Nothing
Complexity: Constant.
Note: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated.
void splice(const_iterator p, list && x) noexcept;
Requires: p must point to an element contained by the list. x != *this. this' allocator and x's allocator shall compare equal
Effects: Transfers all the elements of list x to this list, before the the element pointed by p. No destructors or copy constructors are called.
Throws: Nothing
Complexity: Constant.
Note: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated.
void splice(const_iterator p, list & x, const_iterator i) noexcept;
Requires: p must point to an element contained by this list. i must point to an element contained in list x. this' allocator and x's allocator shall compare equal
Effects: Transfers the value pointed by i, from list x to this list, before the element pointed by p. No destructors or copy constructors are called. If p == i or p == ++i, this function is a null operation.
Throws: Nothing
Complexity: Constant.
Note: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated.
void splice(const_iterator p, list && x, const_iterator i) noexcept;
Requires: p must point to an element contained by this list. i must point to an element contained in list x. this' allocator and x's allocator shall compare equal.
Effects: Transfers the value pointed by i, from list x to this list, before the element pointed by p. No destructors or copy constructors are called. If p == i or p == ++i, this function is a null operation.
Throws: Nothing
Complexity: Constant.
Note: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated.
void splice(const_iterator p, list & x, const_iterator first,
const_iterator last) noexcept;
Requires: p must point to an element contained by this list. first and last must point to elements contained in list x. this' allocator and x's allocator shall compare equal
Effects: Transfers the range pointed by first and last from list x to this list, before the element pointed by p. No destructors or copy constructors are called.
Throws: Nothing
Complexity: Linear to the number of elements transferred.
Note: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated.
void splice(const_iterator p, list && x, const_iterator first,
const_iterator last) noexcept;
Requires: p must point to an element contained by this list. first and last must point to elements contained in list x. this' allocator and x's allocator shall compare equal.
Effects: Transfers the range pointed by first and last from list x to this list, before the element pointed by p. No destructors or copy constructors are called.
Throws: Nothing
Complexity: Linear to the number of elements transferred.
Note: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated.
Requires: p должно указывать на элемент, содержащийся в этом списке. Первый и последний должны указывать на элементы, содержащиеся в списке x. n == расстояние (первый, последний). этот аллокатор и кс аллокатор должны сравнивать равное
Effects: Переносит диапазон, указанный первым и последним из списка x в этот список, до элемента, указанного p. Не называются деструкторы или копировальные конструкторы.
Throws: Nothing
комплексность: Постоян.
Note: Итераторы значений, полученных из списка x теперь указывают на элементы этого списка. Итераторы этого списка и все ссылки не аннулируются.
Note: Нестандартное расширение
Requires: p must point to an element contained by this list. first and last must point to elements contained in list x. n == distance(first, last). this' allocator and x's allocator shall compare equal
Effects: Transfers the range pointed by first and last from list x to this list, before the element pointed by p. No destructors or copy constructors are called.
Throws: Nothing
Complexity: Constant.
Note: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated.
Note: Non-standard extension
[ORIG_END] -->Requires: p должно указывать на элемент, содержащийся в этом списке. Первый и последний должны указывать на элементы, содержащиеся в списке x. n == расстояние (первый, последний). этот аллокатор и кс аллокатор должны сравнивать равное
Effects: Переносит диапазон, указанный первым и последним из списка x в этот список, до элемента, указанного p. Не называются деструкторы или копировальные конструкторы.
Throws: Nothing
комплексность: Постоян.
Note: Итераторы значений, полученных из списка x теперь указывают на элементы этого списка. Итераторы этого списка и все ссылки не аннулируются.
Note: Нестандартное расширение
Requires: p must point to an element contained by this list. first and last must point to elements contained in list x. n == distance(first, last). this' allocator and x's allocator shall compare equal
Effects: Transfers the range pointed by first and last from list x to this list, before the element pointed by p. No destructors or copy constructors are called.
Throws: Nothing
Complexity: Constant.
Note: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated.
Note: Non-standard extension
[ORIG_END] -->void remove(const T & value);
Effects: Removes all the elements that compare equal to value.
Throws: If comparison throws.
Complexity: Linear time. It performs exactly size() comparisons for equality.
Note: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid.
template<typename Pred> void remove_if(Pred pred);
Effects: Removes all the elements for which a specified predicate is satisfied.
Throws: If pred throws.
Complexity: Linear time. It performs exactly size() calls to the predicate.
Note: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid.
void unique();
Effects: Removes adjacent duplicate elements or adjacent elements that are equal from the list.
Throws: If comparison throws.
Complexity: Linear time (size()-1 comparisons equality comparisons).
Note: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid.
template<typename BinaryPredicate> void unique(BinaryPredicate binary_pred);
Effects: Removes adjacent duplicate elements or adjacent elements that satisfy some binary predicate from the list.
Throws: If pred throws.
Complexity: Linear time (size()-1 comparisons calls to pred()).
Note: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid.
void merge(list & x);
Requires: The lists x and *this must be distinct.
Effects: This function removes all of x's elements and inserts them in order into *this according to std::less<value_type>. The merge is stable; that is, if an element from *this is equivalent to one from x, then the element from *this will precede the one from x.
Throws: If comparison throws.
Complexity: This function is linear time: it performs at most size() + x.size() - 1 comparisons.
void merge(list && x);
Requires: The lists x and *this must be distinct.
Effects: This function removes all of x's elements and inserts them in order into *this according to std::less<value_type>. The merge is stable; that is, if an element from *this is equivalent to one from x, then the element from *this will precede the one from x.
Throws: If comparison throws.
Complexity: This function is linear time: it performs at most size() + x.size() - 1 comparisons.
template<typename StrictWeakOrdering>
void merge(list & x, const StrictWeakOrdering & comp);
Requires: p must be a comparison function that induces a strict weak ordering and both *this and x must be sorted according to that ordering The lists x and *this must be distinct.
Effects: This function removes all of x's elements and inserts them in order into *this. The merge is stable; that is, if an element from *this is equivalent to one from x, then the element from *this will precede the one from x.
Throws: If comp throws.
Complexity: This function is linear time: it performs at most size() + x.size() - 1 comparisons.
Note: Iterators and references to *this are not invalidated.
template<typename StrictWeakOrdering>
void merge(list && x, StrictWeakOrdering comp);
Requires: p must be a comparison function that induces a strict weak ordering and both *this and x must be sorted according to that ordering The lists x and *this must be distinct.
Effects: This function removes all of x's elements and inserts them in order into *this. The merge is stable; that is, if an element from *this is equivalent to one from x, then the element from *this will precede the one from x.
Throws: If comp throws.
Complexity: This function is linear time: it performs at most size() + x.size() - 1 comparisons.
Note: Iterators and references to *this are not invalidated.
void sort();
Effects: This function sorts the list *this according to std::less<value_type>. The sort is stable, that is, the relative order of equivalent elements is preserved.
Throws: If comparison throws.
Notes: Iterators and references are not invalidated.
Complexity: The number of comparisons is approximately N log N, where N is the list's size.
template<typename StrictWeakOrdering> void sort(StrictWeakOrdering comp);
Effects: This function sorts the list *this according to std::less<value_type>. The sort is stable, that is, the relative order of equivalent elements is preserved.
Throws: If comp throws.
Notes: Iterators and references are not invalidated.
Complexity: The number of comparisons is approximately N log N, where N is the list's size.
void reverse() noexcept;
Effects: Reverses the order of elements in the list.
Throws: Nothing.
Complexity: This function is linear time.
Note: Iterators and references are not invalidated