O'Reilly logo

Mastering C++ Programming by Jeganathan Swaminathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Commonly used APIs in a forward_list container

The following table shows the commonly used forward_list APIs:

API

Description

front()

This returns the first value stored in the forward_list container

empty()

This returns true when the forward_list container is empty and false, otherwise

clear()

This clears all the values stored in forward_list

push_front<data_type>( value )

This adds a value to the front of forward_list

merge( list )

This merges two sorted forward_list containers with values of the same type

reverse()

This reverses the forward_list container

unique()

This removes duplicate values from the forward_list container

sort()

This sorts the values stored in forward_list

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required