The forward_list::cbegin() is a function in C++ STL which returns a constant iterator pointing to the first element of the forward_list.
Parameters: This function does not accept any parameter.
Return Value: This function returns an iterator that points to the const content. Since the iterator is not constant it can be increased or decreased or modified but as it cannot be used to modify its content even if the forward list is not constant. If the forward list is empty, the iterator returned by the function will not be dereferenced.
The following programs illustrate the use of the function:
1st element of sample: 45
sample: 7 4 9 15
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- deque cbegin() in C++ STL
- unordered_map cbegin in C++ STL
- unordered_multimap cbegin() function in C++ STL
- match_results cbegin() add cend() in C++ STL
- unordered_multiset cbegin() function in C++ STL
- map cbegin() and cend() function in C++ STL
- set cbegin() and cend() function in C++ STL
- unordered_set cbegin() function in C++ STL
- list cbegin() and cend() function in C++ STL
- multiset cbegin() and cend() function in C++ STL
- array::cbegin() and array::cend() in C++ STL
- multimap::cbegin() and multimap::cend() in C++ STL
- vector :: cbegin() and vector :: cend() in C++ STL
- Difference between cout and puts() in C++ with Examples
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.