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
- Generate a random permutation of elements from range [L, R] (Divide and Conquer)
- Passing and Returning Objects in C++
- Train a Support Vector Machine to recognize facial features in C++
- Salesforce Interview Experience | On-Campus for FTE
- unordered_set operators in C++ STL
- Dividing a Large file into Separate Modules in C/C++, Java and Python
- How to delete a range of values from the List using Iterator
- How to create a List with Constructor in C++ STL
- How to delete last element from a List in C++ STL
- Can C++ reference member be declared without being initialized with declaration?
- Finding Floor and Ceil of a Sorted Array using C++ STL
- Some useful C++ tricks for beginners in Competitive Programming
- Replace each node with its Surpasser Count in Linked List
- Comparison of Java with other programming languages
- Print multiples of Unit Digit of Given Number