List Functions 2

Suman Barik
0

Some More Methods of forward_list:

Method

Definition

front()This function is used to reference the first element of the forward list container.
begin()This function is used to return an iterator pointing to the first element of the forward list container.
end()This function is used to return an iterator pointing to the last element of the list container.
cbegin()Returns a constant iterator pointing to the first element of the forward_list.
cend()Returns a constant iterator pointing to the past-the-last element of the forward_list.
before_begin()Returns an iterator that points to the position before the first element of the forward_list.
cbefore_begin()Returns a constant random access iterator which points to the position before the first element of the forward_list.
max_size()Returns the maximum number of elements that can be held by forward_list.
resize()Changes the size of forward_list.
unique()Removes all consecutive duplicate elements from the forward_list. It uses a binary predicate for comparison.
reverse() Reverses the order of the elements present in the forward_list.
Tags

Post a Comment

0Comments
Post a Comment (0)