VOOZH about

URL: https://www.geeksforgeeks.org/cpp/unordered_multiset-cend-function-in-c-stl/

⇱ unordered_multiset cend() function in C++ STL - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

unordered_multiset cend() function in C++ STL

Last Updated : 2 Aug, 2018
The unordered_multiset::cend() is a built-in function in C++ STL which returns a constant iterator pointing to the position immediately after the last element in the container or to the position immediately after the last element in one of its bucket. Syntax:
unordered_multiset_name.cend(n)
Parameters: The function accepts one parameter. If a parameter is passed, it returns a constant iterator pointing to the position immediately after the last element in the bucket. If no parameter is passed, then it returns a constant iterator pointing to the position immediately after the last element in the unordered_multiset container. Return Value: It returns a constant iterator. It cannot be used to modify the content of the container. Below programs illustrate the above function: Program 1:
Output:
Elements: 13 13 10 15 15
Program 2:
Output:
Elements: z a b b b
Program 3:
Output:
Bucket 0: b b b 
Bucket 1: empty
Bucket 2: empty
Bucket 3: z 
Bucket 4: empty
Bucket 5: empty
Bucket 6: a
Comment