The forward_list::max_size() is a built-in function in C++ STL which returns the maximum number of elements a forward_list container can hold
Parameters: The function does not accept any parameters.
Return Value: The function returns the maximum number of elements the container can hold.
Below programs illustrate the above function:
The forward_list elements: 8 8 8 8 8 The max size: 1152921504606846975
The max size: 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.
- multimap maxsize() in C++ STL
- multiset lower_bound() in C++ STL with Examples
- multiset max_size() in C++ STL with Examples
- array data() in C++ STL with Examples
- multiset size() in C++ STL with Examples
- unordered_set get_allocator() in C++ STL with Examples
- not1 and not2 function templates in C++ STL with Examples
- fill() function in C++ STL with examples
- fill_n() function in C++ STL with examples
- Vector of Vectors in C++ STL with Examples
- Map of Vectors in C++ STL with Examples
- Stack of Pair in C++ STL with Examples
- Queue of Pairs in C++ STL with Examples
- multiset upper_bound() in C++ STL with Examples
- Kruskal's Minimum Spanning Tree using STL in C++
- Dijkstra’s shortest path algorithm using set in STL
- Dijkstra's Shortest Path Algorithm using priority_queue of STL
- Prim's algorithm using priority_queue in STL
- unordered_map in C++ STL
- fill() and fill_n() functions in C++ STL
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.