forward_list::cend() is a function in C++ STL which returns a constant iterator pointing to the past-the-last element of the forward_list. The iterator returned by the function does not point to any element in the container, but to the position followed by the last element of the forward list container.
The iterator returned by the function points to constant content. Since the iterator itself is not constant it can be increased or decreased or modified but it cannot be used to modify its content even if the forward list is not constant.
Since the iterator does not point to any element of the forward list, it cannot be dereferenced in any case.
Parameters: The function does not take any parameter.
Return Value: The function returns an iterator pointing to the past-the-end element of the forward list container.
The following programs illustrates the use of the forward_list::cend() function:
sample: 7 54 47 48
- return statement in C/C++ with Examples
- How to implement our own Vector Class in C++?
- Web Programming in C++
- C++ Program to print an Array using Recursion
- Storage Classes in C++ with Examples
- fill_n() function in C++ STL with examples
- fill() function in C++ STL with examples
- How to erase an element from a vector using erase() and reverse_iterator?
- iomanip setbase() function in C++ with Examples
- iomanip setpricision() function in C++ with Examples
- iomanip setiosflags() function in C++ with Examples
- iomanip setfill() function in C++ with Examples
- Manipulators in C++ with Examples
- iomanip setw() function in C++ with Examples
- iomanip resetiosflags() function 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.