bsl::list

Forward declaration required by List_NodeProctor.

Synopsis

Declared in <bslstl_list.h>

template<
    class LIST_VALUE,
    class LIST_ALLOCATOR = bsl::allocator<VALUE>>
class list;

Type Aliases

NameDescription
allocator_type Allocator type used by this list.
const_iterator Iterator providing non-modifiable access to elements in this list.
const_pointer Pointer to a non-modifiable element in this list.
const_reference Reference to a non-modifiable element stored in this list.
const_reverse_iterator Reverse iterator over non-modifiable list elements.
difference_type Signed integral type used to express distances between iterators.
iterator Iterator providing modifiable access to elements in this list.
pointer Pointer to a modifiable element in this list.
reference Reference to an element stored in this list.
reverse_iterator Reverse iterator over modifiable list elements.
size_type Unsigned integral type large enough to hold any valid element count.
value_type Type of the elements stored in this list.

Member Functions

NameDescription
list [constructor]Constructors
~list [destructor]Destroy this list by calling the destructor for each element and deallocating all allocated storage.
operator= Assignment operators
append_range Append to the end of this object the elements of the specified range.
assign assign overloads
assign_range Assign to this object the elements of the specified range.
back back overloads
begin begin overloads
cbegin Return a const iterator to the first element, or end if empty.
cend Return the past-the-end (forward) iterator providing non-modifiable access to this list.
clear Remove all the elements from this list.
crbegin 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.
crend Return a const reverse iterator to the reverse end of this list.
emplace Insert a newly constructed value_type at the specified position.
emplace_back Append a newly constructed value_type object to the back of this list.
emplace_front Prepend a newly constructed value_type object to the front of this list.
empty Return true if this list has no elements, and false otherwise.
end end overloads
erase erase overloads
front front overloads
get_allocator Return a copy of the allocator used for memory allocation by this list.
insert insert overloads
insert_range Insert the elements of range at the specified position.
max_size Return an upper bound on the largest number of elements this list can hold.
merge merge overloads
pop_back Remove and destroy the last element of this list. The behavior is undefined unless this list contains at least one element.
pop_front Remove and destroy the first element of this list. The behavior is undefined unless this list contains at least one element.
prepend_range Prepend to the front of this object the elements of the specified range.
push_back push_back overloads
push_front push_front overloads
rbegin rbegin overloads
remove Erase all elements equal to value and return how many were erased.
remove_if Erase all elements for which predicate is true; return the count.
rend rend overloads
resize resize overloads
reverse Reverse the order of the elements in this list.
size Return the number of elements in this list.
sort sort overloads
splice splice overloads
swap Exchange the value of this object with that of the specified other.
unique unique overloads

Deduction Guides

NameDescription
list<VALUE> Deduce VALUE from the value type of the iterator range constructor.
list<VALUE> Deduce VALUE from an initializer_list when an allocator pointer is given.
list<VALUE> Deduce VALUE from iterators when an allocator pointer is supplied.
list<VALUE> Deduce VALUE from the fill constructor's value argument.
list<VALUE, ALLOCATOR> Deduce VALUE and ALLOCATOR from the iterator-range constructor.
list<ranges::range_value_t<t_RANGE>, t_ALLOCATOR> Deduce the template parameters VALUE_TYPE and ALLOCATOR from the parameters supplied to the constructor of list.

Friends

NameDescription
bsl::List_NodeProctorThis class provides a proctor to free a node containing an uninitialized VALUE object in the event that an exception is thrown.

Non-Member Functions

NameDescription
eraseErase all elements in l that compare equal to value.
erase_ifErase all elements in l that satisfy the specified predicate.
operator<=>Perform a lexicographic three-way comparison of lhs and rhs.
operator==Return true if lhs and rhs have the same value, and false otherwise.
swapExchange the values of the specified a and b lists.