list push_front() function in C++ STL
The list::push_front() is a built-in function in C++ STL which is used to insert an element at the front of a list container just before the current top element. This function also increases the size of the container by 1.
Parameters: This function accepts a single parameter value. This parameter represents the element which is needed to be inserted at the front of the list container.
Return Value: This function does not return anything.
Below program illustrate the list::push_front() function in C++ STL:
Initial List: 10 20 30 40 List after adding elements to the front: 5 10 20 30 40