The list::reverse() is a built-in function in C++ STL which is used to reverse a list container. It reverses the order of elements in the list container.
Parameters: This function does not accept any parameters.
Return Value: This function does not return any value. It just reverses the order of elements in the list container with which it is used.
Below program illustrate the list::reverse() function in C++ STL:
Initial List: 10 20 30 40 List after reversing: 40 30 20 10