BDE 4.14.0 Production release
|
#include <bslstl_list.h>
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) | |
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) |
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 |
Remove all the elements from this list. | |
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... ARGS> | |
reference | emplace_back (ARGS &&... arguments) |
template<class... ARGS> | |
reference | emplace_front (ARGS &&... arguments) |
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) |
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 |
Reverse the order of the elements in this list. | |
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 |
Return true if this list has no elements, and false otherwise. | |
size_type | max_size () const BSLS_KEYWORD_NOEXCEPT |
size_type | size () const BSLS_KEYWORD_NOEXCEPT |
Return the number of elements in this list. | |
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 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 > |
This class template implements a value-semantic container type holding a sequence of elements of the (template parameter) VALUE
type.
See bslstl_list
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
}). The behavior is undefined unless 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 | ( | 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
}). Note that a 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
}). Note that a 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.
|
inline |
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)
. The behavior is undefined unless first
and last
refer to a sequence of valid values where first
is at a position at or before last
. Note that, to the extent possible, existing elements of this list are copy-assigned to, to minimize the number of nodes that need to be copy-inserted or erased. If an exception is thrown, *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
. Note that, to the extent possible, existing elements of this list are copy-assigned to, to minimize the number of nodes that need to be copy-inserted or erased.
|
inline |
Return a reference providing modifiable access to the last element of this list. The behavior is undefined unless this list contains at least one element.
|
inline |
Return a reference providing non-modifiable access to the last element of this list. The behavior is undefined unless this list contains at least one element.
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 |
|
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
}). The behavior is undefined unless 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 |
|
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
. The behavior is undefined unless dstBegin
is an iterator in the range [begin() .. end()]
and dstEnd
is an iterator in the range [dstBegin .. end()]
(both endpoints included). Note that 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. The behavior is undefined unless position
refers to an element in this list.
|
inline |
Return a reference providing modifiable access to the first element of this list. The behavior is undefined unless this list contains at least one element.
|
inline |
Return a reference providing non-modifiable access to the first element of this list. The behavior is undefined unless this list contains at least one element.
|
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
}). The behavior is undefined unless 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
}). The behavior is undefined unless 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
}). The behavior is undefined unless 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
}). The behavior is undefined unless dstPosition
is an iterator in the range [cbegin() .. cend()]
(both endpoints included).
|
inline |
Return an upper bound on the largest number of elements that this list could possibly hold. Note that the return value of this function does not guarantee that this list can successfully grow that large, or even close to that large without running out of resources.
|
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. The behavior is undefined unless both 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}).
|
inline |
|
inline |
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. The behavior is undefined unless both 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. Note that, to the extent possible, existing elements of this list are copy-assigned to, to minimize the number of nodes that need to be copy-inserted or erased.
|
inline |
Remove and destroy the last element of this list. The behavior is undefined unless this list contains at least one element.
|
inline |
Remove and destroy the first element of this list. The behavior is undefined unless this list contains at least one element.
|
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 | ) |
void bsl::list< VALUE, ALLOCATOR >::resize | ( | size_type | newSize, |
const value_type & | value | ||
) |
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 >::reverse | ( | ) |
|
inline |
|
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 |
Remove all elements of the specified src
list and insert them, in the same order, in this list at the specified dstPosition
. The behavior is undefined unless src
is not this list, this list and src
use the same allocator, and dstPosition
is in the range [begin() .. end()]
(note both endpoints included).
|
inline |
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. The behavior is undefined unless [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). Note that 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.
|
inline |
Remove the single element at the specified srcNode
from the specified src
list, and insert it at the specified dstPosition
in this list. The behavior is undefined unless 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). Note that 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 >::splice | ( | const_iterator | dstPosition, |
list< VALUE, ALLOCATOR > & | src | ||
) |
void bsl::list< VALUE, ALLOCATOR >::splice | ( | const_iterator | dstPosition, |
list< VALUE, ALLOCATOR > & | src, | ||
const_iterator | first, | ||
const_iterator | last | ||
) |
void bsl::list< VALUE, ALLOCATOR >::splice | ( | const_iterator | dstPosition, |
list< VALUE, ALLOCATOR > & | src, | ||
const_iterator | srcNode | ||
) |
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 |