std::forward_list::max_size() is an inbuilt function in CPP STL which returns the maximum number of elements can be held by forward_list. This value depends on system or library implementation.
Parameters: The function does not accept any parameters.
Return value:The function returns the maximum numbers that can be stored into the forward_list.
Below program demonstrates the above function:
Max_size of the list is 1152921504606846975
Rated as one of the most sought after skills in the industry, own the basics of coding with our C++ STL Course and master the very concepts by intense problem-solving.