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
- Find the node whose sum with X has minimum set bits
- Salt and Pepper Noise removal using C++
- C++ Stream Classes Structure
- OpenMP | Hello World program
- Odd Even Transposition Sort / Brick Sort using pthreads
- Chat application between two processes using signals and shared memory
- Find k closest numbers in an unsorted array
- Intel Graphics Software Engineer Interview Experience
- OpenMP | Introduction with Installation Guide
- Equation of straight line passing through a given point which bisects it into two equal line segments
- Maximum absolute difference in an array
- Count the pairs of vowels in the given string
- Why overriding both the global new operator and the class-specific operator is not ambiguous?
- Print path from root to all nodes in a Complete Binary Tree
- Count the number of 1's and 0's in a binary array using STL in C++ ?
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.