|
BDE 4.39.x Production Release
|
#include <bslstl_list.h>
Forward declaration required by List_NodeProctor.
This class template implements a value-semantic container type holding a sequence of elements of the (template parameter) VALUE type.
See bslstl_list
Public Types | |
| typedef VALUE & | reference |
| typedef const VALUE & | const_reference |
| typedef List_Iterator< VALUE > | iterator |
| typedef List_Iterator< const VALUE > | const_iterator |
| typedef allocator_traits< ALLOCATOR >::pointer | pointer |
| typedef allocator_traits< ALLOCATOR >::const_pointer | const_pointer |
| typedef allocator_traits< ALLOCATOR >::size_type | size_type |
| typedef allocator_traits< ALLOCATOR >::difference_type | difference_type |
| typedef VALUE | value_type |
| typedef ALLOCATOR | allocator_type |
| typedef bsl::reverse_iterator< iterator > | reverse_iterator |
| typedef bsl::reverse_iterator< const_iterator > | const_reverse_iterator |
Public Member Functions | |
| list () | |
| list (const ALLOCATOR &basicAllocator) | |
| list (size_type numElements) | |
| list (size_type numElements, const ALLOCATOR &basicAllocator) | |
| list (size_type numElements, const value_type &value, const ALLOCATOR &basicAllocator=ALLOCATOR()) | |
| template<class INPUT_ITERATOR > | |
| list (INPUT_ITERATOR first, INPUT_ITERATOR last, const ALLOCATOR &basicAllocator=ALLOCATOR(), typename enable_if< !is_arithmetic< INPUT_ITERATOR >::value &&!is_enum< INPUT_ITERATOR >::value >::type *=0) | |
| template<class t_RANGE > | |
| list (from_range_t, BSLS_COMPILERFEATURES_FORWARD_REF(t_RANGE) range, const ALLOCATOR &basicAllocator=ALLOCATOR()) | |
| list (const list &original) | |
| list (const list &original, const typename type_identity< ALLOCATOR >::type &basicAllocator) | |
| list (BloombergLP::bslmf::MovableRef< list > original) | |
| list (BloombergLP::bslmf::MovableRef< list > original, const typename type_identity< ALLOCATOR >::type &basicAllocator) | |
| ~list () | |
| list & | operator= (const list &rhs) |
| template<class INPUT_ITERATOR > | |
| list &operator=(BloombergLP::bslmf::MovableRef< list > rhs) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(AllocTraits void | assign (INPUT_ITERATOR first, INPUT_ITERATOR last, typename enable_if< !is_arithmetic< INPUT_ITERATOR >::value &&!is_enum< INPUT_ITERATOR >::value >::type *=0) |
| void | assign (size_type numElements, const value_type &value) |
| template<class t_RANGE > | |
| void | assign_range (BSLS_COMPILERFEATURES_FORWARD_REF(t_RANGE) range) |
| iterator | begin () BSLS_KEYWORD_NOEXCEPT |
| iterator | end () BSLS_KEYWORD_NOEXCEPT |
| reverse_iterator | rbegin () BSLS_KEYWORD_NOEXCEPT |
| reverse_iterator | rend () BSLS_KEYWORD_NOEXCEPT |
| void | clear () BSLS_KEYWORD_NOEXCEPT |
| void | resize (size_type newSize) |
| void | resize (size_type newSize, const value_type &value) |
| reference | back () |
| reference | front () |
| void | pop_back () |
| void | pop_front () |
| iterator | erase (const_iterator position) |
| iterator | erase (const_iterator dstBegin, const_iterator dstEnd) |
| template<class t_RANGE > | |
| void | append_range (BSLS_COMPILERFEATURES_FORWARD_REF(t_RANGE) range) |
| template<class... ARGS> | |
| reference | emplace_back (ARGS &&... arguments) |
| template<class... ARGS> | |
| reference | emplace_front (ARGS &&... arguments) |
| template<class t_RANGE > | |
| void | prepend_range (BSLS_COMPILERFEATURES_FORWARD_REF(t_RANGE) range) |
| void | push_back (const value_type &value) |
| void | push_back (BloombergLP::bslmf::MovableRef< value_type > value) |
| void | push_front (const value_type &value) |
| void | push_front (BloombergLP::bslmf::MovableRef< value_type > value) |
| template<class... ARGS> | |
| iterator | emplace (const_iterator position, ARGS &&... arguments) |
| iterator | insert (const_iterator dstPosition, const value_type &value) |
| iterator | insert (const_iterator dstPosition, BloombergLP::bslmf::MovableRef< value_type > value) |
| iterator | insert (const_iterator dstPosition, size_type numElements, const value_type &value) |
| template<class INPUT_ITERATOR > | |
| iterator | insert (const_iterator dstPosition, INPUT_ITERATOR first, INPUT_ITERATOR last, typename enable_if< !is_arithmetic< INPUT_ITERATOR >::value &&!is_enum< INPUT_ITERATOR >::value >::type *=0) |
| template<class t_RANGE > | |
| iterator | insert_range (const_iterator position, BSLS_COMPILERFEATURES_FORWARD_REF(t_RANGE) range) |
| void | merge (list &other) |
| void | merge (BloombergLP::bslmf::MovableRef< list > other) |
| template<class COMPARE > | |
| void | merge (list &other, COMPARE comparator) |
| template<class COMPARE > | |
| void | merge (BloombergLP::bslmf::MovableRef< list > other, COMPARE comparator) |
| size_type | remove (const value_type &value) |
| template<class PREDICATE > | |
| size_type | remove_if (PREDICATE predicate) |
| void | reverse () BSLS_KEYWORD_NOEXCEPT |
| void | sort () |
| template<class COMPARE > | |
| void | sort (COMPARE comparator) |
| void | splice (const_iterator dstPosition, list &src) |
| void | splice (const_iterator dstPosition, BloombergLP::bslmf::MovableRef< list > src) |
| void | splice (const_iterator dstPosition, list &src, const_iterator srcNode) |
| void | splice (const_iterator dstPosition, BloombergLP::bslmf::MovableRef< list > src, const_iterator srcNode) |
| void | splice (const_iterator dstPosition, list &src, const_iterator first, const_iterator last) |
| void | splice (const_iterator dstPosition, BloombergLP::bslmf::MovableRef< list > src, const_iterator first, const_iterator last) |
| void | unique () |
| template<class EQ_PREDICATE > | |
| void | unique (EQ_PREDICATE binaryPredicate) |
| const_iterator | cbegin () const BSLS_KEYWORD_NOEXCEPT |
| const_iterator | end () const BSLS_KEYWORD_NOEXCEPT |
| const_iterator | cend () const BSLS_KEYWORD_NOEXCEPT |
| const_reverse_iterator | rbegin () const BSLS_KEYWORD_NOEXCEPT |
| const_reverse_iterator | crbegin () const BSLS_KEYWORD_NOEXCEPT |
| const_reverse_iterator | rend () const BSLS_KEYWORD_NOEXCEPT |
| const_reverse_iterator | crend () const BSLS_KEYWORD_NOEXCEPT |
| bool | empty () const BSLS_KEYWORD_NOEXCEPT |
| size_type | max_size () const BSLS_KEYWORD_NOEXCEPT |
| size_type | size () const BSLS_KEYWORD_NOEXCEPT |
| const_reference | back () const |
| const_reference | front () const |
| allocator_type | get_allocator () const BSLS_KEYWORD_NOEXCEPT |
| template<class COMPARE > | |
| list< VALUE, ALLOCATOR >::NodePtr | mergeImp (NodePtr node1, NodePtr node2, NodePtr finish, COMPARE comparator) |
| template<class COMPARE > | |
| list< VALUE, ALLOCATOR >::NodePtr | sortImp (NodePtr *nodePtrPtr, size_type size, const COMPARE &comparator) |
| template<class... ARGS> | |
| list< VALUE, ALLOCATOR >::reference | emplace_back (ARGS &&... arguments) |
| template<class... ARGS> | |
| list< VALUE, ALLOCATOR >::reference | emplace_front (ARGS &&... arguments) |
| template<class... ARGS> | |
| list< VALUE, ALLOCATOR >::iterator | emplace (const_iterator position, ARGS &&... arguments) |
| template<class t_RANGE > | |
| list< VALUE, ALLOCATOR >::iterator | insert_range (const_iterator position, BSLS_COMPILERFEATURES_FORWARD_REF(t_RANGE) range) |
| template<class PREDICATE > | |
| list< VALUE, ALLOCATOR >::size_type | remove_if (PREDICATE predicate) |
Public Attributes | |
| void swap(list &other) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(AllocTraits const_iterator | begin () const BSLS_KEYWORD_NOEXCEPT |
Friends | |
| class | List_NodeProctor< VALUE, ALLOCATOR > |
| typedef ALLOCATOR bsl::list< VALUE, ALLOCATOR >::allocator_type |
| typedef List_Iterator<const VALUE> bsl::list< VALUE, ALLOCATOR >::const_iterator |
| typedef allocator_traits<ALLOCATOR>::const_pointer bsl::list< VALUE, ALLOCATOR >::const_pointer |
| typedef const VALUE& bsl::list< VALUE, ALLOCATOR >::const_reference |
| typedef bsl::reverse_iterator<const_iterator> bsl::list< VALUE, ALLOCATOR >::const_reverse_iterator |
| typedef allocator_traits<ALLOCATOR>::difference_type bsl::list< VALUE, ALLOCATOR >::difference_type |
| typedef List_Iterator<VALUE> bsl::list< VALUE, ALLOCATOR >::iterator |
| typedef allocator_traits<ALLOCATOR>::pointer bsl::list< VALUE, ALLOCATOR >::pointer |
| typedef VALUE& bsl::list< VALUE, ALLOCATOR >::reference |
| typedef bsl::reverse_iterator<iterator> bsl::list< VALUE, ALLOCATOR >::reverse_iterator |
| typedef allocator_traits<ALLOCATOR>::size_type bsl::list< VALUE, ALLOCATOR >::size_type |
| typedef VALUE bsl::list< VALUE, ALLOCATOR >::value_type |
| bsl::list< VALUE, ALLOCATOR >::list | ( | ) |
Create an empty list. A default-constructed object of the (template parameter) type ALLOCATOR is used. If the type ALLOCATOR is bsl::allocator, the currently installed default allocator is used.
|
explicit |
Create an empty list. Use the specified basicAllocator to supply memory. If the type ALLOCATOR is bsl::allocator (the default), then basicAllocator shall be convertible to bslma::Allocator *.
|
explicit |
Create a list of the specified numElements size whose every element is default-constructed. A default-constructed object of the (template parameter) type ALLOCATOR is used. If the type ALLOCATOR is bsl::allocator, the currently installed default allocator is used. Throw bsl::length_error if numElements > max_size(). This method requires that the (template parameter) VALUE be default-insertable into this list (see {Requirements on VALUE}).
| bsl::list< VALUE, ALLOCATOR >::list | ( | size_type | numElements, |
| const ALLOCATOR & | basicAllocator | ||
| ) |
Create a list of the specified numElements size whose every element is default-constructed. Use the specified basicAllocator to supply memory. If the type ALLOCATOR is bsl::allocator (the default), then basicAllocator shall be convertible to bslma::Allocator *. Throw bsl::length_error if numElements > max_size(). This method requires that the (template parameter) VALUE be default-insertable into this list (see {Requirements on VALUE}).
| bsl::list< VALUE, ALLOCATOR >::list | ( | size_type | numElements, |
| const value_type & | value, | ||
| const ALLOCATOR & | basicAllocator = ALLOCATOR() |
||
| ) |
Create a list of the specified numElements size whose every element has the specified value. Optionally specify a basicAllocator used to supply memory. If basicAllocator is not supplied, a default-constructed object of the (template parameter) type ALLOCATOR is used. If the type ALLOCATOR is bsl::allocator (the default), then basicAllocator, if supplied, shall be convertible to bslma::Allocator *. If the type ALLOCATOR is bsl::allocator and basicAllocator is not supplied, the currently installed default allocator is used. Throw bsl::length_error if numElements > max_size(). This method requires that the (template parameter) VALUE be copy-insertable into this list (see {Requirements on VALUE}).
|
inline |
Create a list initially containing copies of the values in the range starting at the specified first and ending immediately before the specified last iterators of the (template parameter) type INPUT_ITERATOR. Optionally specify a basicAllocator used to supply memory. If basicAllocator is not supplied, a default-constructed object of the (template parameter) type ALLOCATOR is used. If the type ALLOCATOR is bsl::allocator (the default), then basicAllocator, if supplied, shall be convertible to bslma::Allocator *. If the type ALLOCATOR is bsl::allocator and basicAllocator is not supplied, the currently installed default allocator is used. Throw bsl::length_error if the number of elements in [first .. last) exceeds the size returned by max_size . The (template parameter) type INPUT_ITERATOR shall meet the requirements of an input iterator defined in the C++11 standard [input.iterators] providing access to values of a type convertible to value_type, and value_type must be emplace-constructible from *i into this list, where i is a dereferenceable iterator in the range [first .. last) (see {Requirements on VALUE}).
first and last refer to a sequence of valid values where first is at a position at or before last. | bsl::list< VALUE, ALLOCATOR >::list | ( | from_range_t | , |
| BSLS_COMPILERFEATURES_FORWARD_REF(t_RANGE) | range, | ||
| const ALLOCATOR & | basicAllocator = ALLOCATOR() |
||
| ) |
Create a list from the elements of the specifed range. Optionally specify an basicAllocator used to supply memory. If basicAllocator is not specified, a default-constructed object of the (template parameter) type ALLOCATOR is used.
range must meet the requirements of an input range and the values from range must have a type matching or convertible to (template parameter) VALUE. | bsl::list< VALUE, ALLOCATOR >::list | ( | const list< VALUE, ALLOCATOR > & | original | ) |
Create a list having the same value as the specified original object. Use the allocator returned by 'bsl::allocator_traits<ALLOCATOR>:: select_on_container_copy_construction(original.get_allocator())' to allocate memory. This method requires that the (template parameter) type VALUE be copy-insertable into this list (see {Requirements on VALUE}).
| bsl::list< VALUE, ALLOCATOR >::list | ( | const list< VALUE, ALLOCATOR > & | original, |
| const typename type_identity< ALLOCATOR >::type & | basicAllocator | ||
| ) |
Create a list that has the same value as the specified original object. Use the specified basicAllocator to supply memory. This method requires that the (template parameter) VALUE be copy-insertable into this list (see {Requirements on VALUE}).
bslma::Allocator * can be supplied for basicAllocator if the (template parameter) type ALLOCATOR is bsl::allocator (the default). | bsl::list< VALUE, ALLOCATOR >::list | ( | BloombergLP::bslmf::MovableRef< list< VALUE, ALLOCATOR > > | original | ) |
Create a list having the same value as the specified original object by moving (in constant time) the contents of original to the new list. The allocator associated with original is propagated for use in the newly-created list. original is left in a valid but unspecified state.
| bsl::list< VALUE, ALLOCATOR >::list | ( | BloombergLP::bslmf::MovableRef< list< VALUE, ALLOCATOR > > | original, |
| const typename type_identity< ALLOCATOR >::type & | basicAllocator | ||
| ) |
Create a list having the same value as the specified original object that uses the specified basicAllocator to supply memory. The contents of original are moved (in constant time) to the new list if basicAllocator == original.get_allocator(), and are move- inserted (in linear time) using basicAllocator otherwise. original is left in a valid but unspecified state. This method requires that the (template parameter) VALUE be move-insertable into this list (see {Requirements on VALUE}).
bslma::Allocator * can be supplied for basicAllocator if the (template parameter) ALLOCATOR is bsl::allocator (the default). Destroy this list by calling the destructor for each element and deallocating all allocated storage.
| void bsl::list< VALUE, ALLOCATOR >::append_range | ( | BSLS_COMPILERFEATURES_FORWARD_REF(t_RANGE) | range | ) |
Append to the end of this object the elements of the specified range.
range must meet the requirements of an input range and the values from range must have a type matching or convertible to (template parameter) VALUE.
|
inline |
Assign to this object the value of the specified rhs object, propagate to this object the allocator of rhs if the ALLOCATOR type has trait propagate_on_container_move_assignment , and return a reference providing modifiable access to this object. The contents of rhs are moved (in constant time) to this list if get_allocator() == rhs.get_allocator() (after accounting for the aforementioned trait); otherwise, all elements in this list are either destroyed or move-assigned to and each additional element in rhs is move-inserted into this list. rhs is left in a valid but unspecified state, and if an exception is thrown, *this is left in a valid but unspecified state. This method requires that the (template parameter) type VALUE be move-assignable and move-insertable into this list (see {Requirements on VALUE}). Assign to this list the sequence of values, in order, of the elements of the specified range [first .. last). The (template parameter) type INPUT_ITERATOR shall meet the requirements of an input iterator defined in the C++11 standard [24.2.3] providing access to values of a type convertible to value_type, and value_type must be emplace-constructible from *i into this list, where i is a dereferenceable iterator in the range [first .. last).
first and last refer to a sequence of valid values where first is at a position at or before last. *this is left in a valid but unspecified state. | void bsl::list< VALUE, ALLOCATOR >::assign | ( | size_type | numElements, |
| const value_type & | value | ||
| ) |
Replace the contents of this list with the specified numElements copies of the specified value.
| void bsl::list< VALUE, ALLOCATOR >::assign_range | ( | BSLS_COMPILERFEATURES_FORWARD_REF(t_RANGE) | range | ) |
Assign to this object the elements of the specified range.
range must meet the requirements of an input range and the values from range must have a type matching or convertible to (template parameter) VALUE.
|
inline |
Return a reference providing modifiable access to the last element of this list.
|
inline |
Return a reference providing non-modifiable access to the last element of this list.
| iterator bsl::list< VALUE, ALLOCATOR >::begin | ( | ) |
Return an iterator providing modifiable access to the first element in this list, and the past-the-end iterator if this list is empty.
|
inline |
Return an iterator providing non-modifiable access to the first value_type object in the ordered sequence of value_type objects maintained by this list, or the end iterator if this list is empty.
|
inline |
Return the past-the-end (forward) iterator providing non-modifiable access to this list.
|
inline |
Remove all the elements from this list.
|
inline |
Return a reverse iterator providing non-modifiable access to the last element in this list, and the past-the-end reverse iterator if this list is empty.
|
inline |
Return the past-the-end reverse iterator providing non-modifiable access to this list.
| iterator bsl::list< VALUE, ALLOCATOR >::emplace | ( | const_iterator | position, |
| ARGS &&... | arguments | ||
| ) |
Insert at the specified position in this list a newly created value_type object, constructed by forwarding get_allocator() (if required) and the specified (variable number of) arguments to the corresponding constructor of value_type, and return an iterator providing modifiable access to the newly created and inserted element. If an exception is thrown (other than by the copy constructor, move constructor, assignment operator, or move assignment operator of value_type), this method has no effect. This method requires that the (template parameter) VALUE be move-insertable into this list and emplace-constructible from arguments (see {Requirements on VALUE}).
position is an iterator in the range [cbegin() .. cend()] (both endpoints included). | list< VALUE, ALLOCATOR >::iterator bsl::list< VALUE, ALLOCATOR >::emplace | ( | const_iterator | position, |
| ARGS &&... | arguments | ||
| ) |
| reference bsl::list< VALUE, ALLOCATOR >::emplace_back | ( | ARGS &&... | arguments | ) |
Append to the back of this list a newly created value_type object, constructed by forwarding get_allocator() (if required) and the specified (variable number of) arguments to the corresponding constructor of value_type. Return a reference providing modifiable access to the inserted element. If an exception is thrown (other than by the move constructor of a non-copy-insertable value_type), this method has no effect. This method requires that the (template parameter) VALUE be move-insertable into this list and emplace-constructible from arguments (see {Requirements on VALUE}).
|
inline |
| reference bsl::list< VALUE, ALLOCATOR >::emplace_front | ( | ARGS &&... | arguments | ) |
Prepend to the front of this list a newly created value_type object, constructed by forwarding get_allocator() (if required) and the specified (variable number of) arguments to the corresponding constructor of value_type. Return a reference providing modifiable access to the inserted element. If an exception is thrown (other than by the move constructor of a non-copy-insertable value_type), this method has no effect. This method requires that the (template parameter) VALUE be move-insertable into this list and emplace-constructible from arguments (see {Requirements on VALUE}).
|
inline |
|
inline |
Return true if this list has no elements, and false otherwise.
|
inline |
Return the past-the-end (forward) iterator providing modifiable access to this list.
|
inline |
| list< VALUE, ALLOCATOR >::iterator bsl::list< VALUE, ALLOCATOR >::erase | ( | const_iterator | dstBegin, |
| const_iterator | dstEnd | ||
| ) |
Remove from this list the elements starting at the specified dstBegin position up to, but not including, the specified dstEnd position, and return a non-const iterator equivalent to dstEnd.
dstBegin is an iterator in the range [begin() .. end()] and dstEnd is an iterator in the range [dstBegin .. end()] (both endpoints included). dstBegin may be equal to dstEnd, in which case the list is not modified. | list< VALUE, ALLOCATOR >::iterator bsl::list< VALUE, ALLOCATOR >::erase | ( | const_iterator | position | ) |
Remove from this list the element at the specified position, and return an iterator providing modifiable access to the element immediately following the removed element, or to the position returned by the end method if the removed element was the last in the sequence.
position refers to an element in this list.
|
inline |
Return a reference providing modifiable access to the first element of this list.
|
inline |
Return a reference providing non-modifiable access to the first element of this list.
|
inline |
Return a copy of the allocator used for memory allocation by this list.
| list< VALUE, ALLOCATOR >::iterator bsl::list< VALUE, ALLOCATOR >::insert | ( | const_iterator | dstPosition, |
| BloombergLP::bslmf::MovableRef< value_type > | value | ||
| ) |
Insert at the specified dstPosition in this list the specified move-insertable value, and return an iterator providing modifiable access to the newly inserted element. value is left in a valid but unspecified state. If an exception is thrown (other than by the copy constructor, move constructor, assignment operator, or move assignment operator of value_type), this method has no effect. This method requires that the (template parameter) VALUE be move-insertable into this list (see {Requirements on VALUE}).
dstPosition is an iterator in the range [cbegin() .. cend()] (both endpoints included). | list< VALUE, ALLOCATOR >::iterator bsl::list< VALUE, ALLOCATOR >::insert | ( | const_iterator | dstPosition, |
| const value_type & | value | ||
| ) |
Insert at the specified dstPosition in this list a copy of the specified value, and return an iterator providing modifiable access to the newly inserted element. This method offers full guarantee of rollback in case an exception is thrown other than by the VALUE copy constructor or assignment operator. This method requires that the (template parameter) VALUE be copy-insertable into this list (see {Requirements on VALUE}).
dstPosition is an iterator in the range [cbegin() .. cend()] (both endpoints included).
|
inline |
Insert at the specified dstPosition in this list the values in the range starting at the specified first and ending immediately before the specified last iterators of the (template parameter) type INPUT_ITERATOR, and return an iterator providing modifiable access to the first element in the newly inserted sequence of elements. The (template parameter) type INPUT_ITERATOR shall meet the requirements of an input iterator defined in the C++11 standard [input.iterators] providing access to values of a type convertible to value_type, and value_type must be emplace-constructible from *i into this list, where i is a dereferenceable iterator in the range [first .. last) (see {Requirements on VALUE}).
dstPosition is an iterator in the range [cbegin() .. cend()] (both endpoints included), and first and last refer to a sequence of valid values where first is at a position at or before last. | list< VALUE, ALLOCATOR >::iterator bsl::list< VALUE, ALLOCATOR >::insert | ( | const_iterator | dstPosition, |
| size_type | numElements, | ||
| const value_type & | value | ||
| ) |
Insert at the specified dstPosition in this list the specified numElements copies of the specified value, and return an iterator providing modifiable access to the first element in the newly inserted sequence of elements. This method requires that the (template parameter) VALUE be copy-insertable into this list (see {Requirements on VALUE}).
dstPosition is an iterator in the range [cbegin() .. cend()] (both endpoints included). | iterator bsl::list< VALUE, ALLOCATOR >::insert_range | ( | const_iterator | position, |
| BSLS_COMPILERFEATURES_FORWARD_REF(t_RANGE) | range | ||
| ) |
Insert at the specified position in this object the elements of the specified range.
range must meet the requirements of an input range and the values from range must have a type matching or convertible to (template parameter) VALUE. | list< VALUE, ALLOCATOR >::iterator bsl::list< VALUE, ALLOCATOR >::insert_range | ( | const_iterator | position, |
| BSLS_COMPILERFEATURES_FORWARD_REF(t_RANGE) | range | ||
| ) |
|
inline |
Return an upper bound on the largest number of elements that this list could possibly hold.
|
inline |
|
inline |
|
inline |
Merge the specified sorted other list into this sorted list. This method has no effect if other is this list; otherwise, other is left empty.
other and this list are sorted in non-decreasing order according to the ordering provided by operator<, and unless both other and this list use the same allocator. operator< must define a strict weak ordering per value_type (see {Comparators and Strict Weak Ordering}). | void bsl::list< VALUE, ALLOCATOR >::merge | ( | list< VALUE, ALLOCATOR > & | other, |
| COMPARE | comparator | ||
| ) |
Merge the specified sorted other list into this sorted list, using the specified binary comparator predicate to order elements. This method has no effect if other is this list; otherwise, other is left empty.
other and this list are sorted in non-decreasing order according to the ordering provided by comparator, and unless both other and this list use the same allocator. | list< VALUE, ALLOCATOR >::NodePtr bsl::list< VALUE, ALLOCATOR >::mergeImp | ( | NodePtr | node1, |
| NodePtr | node2, | ||
| NodePtr | finish, | ||
| COMPARE | comparator | ||
| ) |
| list< VALUE, ALLOCATOR > & bsl::list< VALUE, ALLOCATOR >::operator= | ( | const list< VALUE, ALLOCATOR > & | rhs | ) |
Assign to this object the value of the specified rhs object, propagate to this object the allocator of rhs if the ALLOCATOR type has trait propagate_on_container_copy_assignment , and return a reference providing modifiable access to this object. If an exception is thrown, *this is left in a valid but unspecified state. This method requires that the (template parameter) type VALUE be copy-assignable and copy-insertable into this list.
|
inline |
Remove and destroy the last element of this list.
|
inline |
Remove and destroy the first element of this list.
| void bsl::list< VALUE, ALLOCATOR >::prepend_range | ( | BSLS_COMPILERFEATURES_FORWARD_REF(t_RANGE) | range | ) |
Prepend to the front of this object the elements of the specified range.
range must meet the requirements of an input range and the values from range must have a type matching or convertible to (template parameter) VALUE.
|
inline |
Append to the back of this list the specified move-insertable value. value is left in a valid but unspecified state. If an exception is thrown (other than by the move constructor of a non-copy-insertable value_type), this method has no effect. This method requires that the (template parameter) VALUE be move-insertable into this list (see {Requirements on VALUE}).
|
inline |
Append to the back of this list a copy of the specified value. This method offers full guarantee of rollback in case an exception is thrown. This method requires that the (template parameter) VALUE be copy-constructible (see {Requirements on VALUE}).
|
inline |
Prepend to the front of this list the specified move-insertable value. value is left in a valid but unspecified state. If an exception is thrown (other than by the move constructor of a non-copy-insertable value_type), this method has no effect. This method requires that the (template parameter) VALUE be move-insertable into this list (see {Requirements on VALUE}).
|
inline |
Prepend to the front of this list a copy of the specified value. This method offers full guarantee of rollback in case an exception is thrown. This method requires that the (template parameter) VALUE be copy-constructible (see {Requirements on VALUE}).
|
inline |
Return a reverse iterator providing modifiable access to the last element in this list, and the past-the-end reverse iterator if this list is empty.
|
inline |
| list< VALUE, ALLOCATOR >::size_type bsl::list< VALUE, ALLOCATOR >::remove | ( | const value_type & | value | ) |
Erase all the elements having the specified value from this list and return the number of erased elements.
| size_type bsl::list< VALUE, ALLOCATOR >::remove_if | ( | PREDICATE | predicate | ) |
Erase all the elements in this list for which the specified unary predicate returns true and return the number of erased elements.
| list< VALUE, ALLOCATOR >::size_type bsl::list< VALUE, ALLOCATOR >::remove_if | ( | PREDICATE | predicate | ) |
|
inline |
Return the past-the-end reverse iterator providing modifiable access to this list.
|
inline |
| void bsl::list< VALUE, ALLOCATOR >::resize | ( | size_type | newSize | ) |
Change the size of this list to the specified newSize. Erase size() - newSize elements at the back if newSize < size(). Append newSize - size() elements at the back having the optionally specified value if newSize > size(); if value is not specified, default-constructed objects of the (template parameter) VALUE are emplaced. This method has no effect if newSize == size(). Throw bsl::length_error if newSize > max_size().
| void bsl::list< VALUE, ALLOCATOR >::resize | ( | size_type | newSize, |
| const value_type & | value | ||
| ) |
| void bsl::list< VALUE, ALLOCATOR >::reverse | ( | ) |
Reverse the order of the elements in this list.
|
inline |
Return the number of elements in this list.
|
inline |
Sort this list in non-decreasing order according to the order provided by operator<. operator< must provide a strict weak ordering over value_type (see Comparators and Strict Weak Ordering ). The sort is stable, meaning that if !(a < b) && !(b < a), then the ordering of elements a and b in the sequence is preserved.
| void bsl::list< VALUE, ALLOCATOR >::sort | ( | COMPARE | comparator | ) |
Sort this list in non-decreasing order according to the order provided by the specified comparator predicate. comparator must define a strict weak ordering over value_type (see Comparators and Strict Weak Ordering ). The sort is stable, meaning that if !comparator(a, b) && !comparator(b, a), then the ordering of elements a and b in the sequence is preserved.
| list< VALUE, ALLOCATOR >::NodePtr bsl::list< VALUE, ALLOCATOR >::sortImp | ( | NodePtr * | nodePtrPtr, |
| size_type | size, | ||
| const COMPARE & | comparator | ||
| ) |
|
inline |
|
inline |
|
inline |
| void bsl::list< VALUE, ALLOCATOR >::splice | ( | const_iterator | dstPosition, |
| list< VALUE, ALLOCATOR > & | src | ||
| ) |
Remove all elements of the specified src list and insert them, in the same order, in this list at the specified dstPosition.
| void bsl::list< VALUE, ALLOCATOR >::splice | ( | const_iterator | dstPosition, |
| list< VALUE, ALLOCATOR > & | src, | ||
| const_iterator | first, | ||
| const_iterator | last | ||
| ) |
Remove the elements in the specified range [first .. last) from the specified src list, and insert them, in the same order, at the specified dstPosition in this list.
[first .. last) represents a range of valid elements in src, dstPosition is not in the range [first .. last), this list and src use the same allocator, and dstPosition is in the range [begin() .. end()] (note both endpoints included). src and *this may be the same list, in which case an entire sequence of nodes is moved to a (possibly) new position in this list. | void bsl::list< VALUE, ALLOCATOR >::splice | ( | const_iterator | dstPosition, |
| list< VALUE, ALLOCATOR > & | src, | ||
| const_iterator | srcNode | ||
| ) |
Remove the single element at the specified srcNode from the specified src list, and insert it at the specified dstPosition in this list.
srcNode refers to a valid element in src, this list and src use the same allocator, and dstPosition is in the range [begin() .. end()] (note both endpoints included). src and *this may be the same list, in which case the element is moved to a (possibly) new position in the list. | void bsl::list< VALUE, ALLOCATOR >::unique | ( | ) |
Erase from this list all but the first element of every consecutive group of elements that have the same value.
| void bsl::list< VALUE, ALLOCATOR >::unique | ( | EQ_PREDICATE | binaryPredicate | ) |
Erase from this list all but the first element of every consecutive group of elements for which the specified binaryPredicate returns true for any two consecutive elements in the group.
|
friend |
|
inline |
Exchange the value of this object with that of the specified other object; also exchange the allocator of this object with that of other if the (template parameter) type ALLOCATOR has the propagate_on_container_swap trait, and do not modify either allocator otherwise. This method provides the no-throw exception-safety guarantee. This operation has O[1] complexity if either this object was created with the same allocator as other or ALLOCATOR has the propagate_on_container_swap trait; otherwise, it has O[n + m] complexity, where n and m are the number of elements in this object and other, respectively.
s support for swapping objects created with different allocators whenALLOCATOR` does not have the propagate_on_container_swap trait is a departure from the C++ Standard.