The unordered_map::end() is a built-in function in C++ STL which returns an iterator pointing to the position past the last element in the container in the unordered_map container. In an unordered_map object, there is no guarantee that which specific element is considered its first element. But all the elements in the container are covered since the range goes from its begin to its end until invalidated.
Parameters : This function accepts one parameter n which is an optional parameter that specifies the bucket number. If it is set, the iterator retrieves points to the past-the-end element of a bucket, otherwise, it points to the past-the-end element of the container.
Return value: The function returns an iterator to the element past the end of the container.
Below programs illustrates the above-mentioned function:
marks bucket contains : bucket #0 contains: bucket #1 contains: bucket #2 contains: bucket #3 contains:(Aman, 37), (Rohit, 64), bucket #4 contains:(Ayush, 96),
Marks of Ayush is 96 and his bucket number is 4 Marks of Aman is 37 and his bucket number is 3 Marks of Rohit is 64 and his bucket number is 3
Rated as one of the most sought after skills in the industry, own the basics of coding with our C++ STL Course and master the very concepts by intense problem-solving.
- unordered_multimap begin() and end() function in C++ STL
- list end() function in C++ STL
- multiset begin() and end() function in C++ STL
- unordered_multiset end() function in C++ STL
- match_results begin() and end() function in C++ STL
- array::begin() and array::end() in C++ STL
- deque::begin() and deque::end in C++ STL
- forward_list::begin() and forward_list::end() in C++ STL
- map::begin() and end() in C++ STL
- multimap::begin() and multimap::end() in C++ STL
- unordered_set end() in C++ STL
- vector::begin() and vector::end() in C++ STL
- list::begin() and list::end() in C++ STL
- set::begin() and set::end() in C++ STL
- valarray end() function in C++
- Pair with given sum and maximum shortest distance from end
- Maximum sum subarray such that start and end values are same
- Append digits to the end of dupicate strings to make all strings in an array unique
- atanh() function in C++ STL
- vector rbegin() and rend() function in C++ STL
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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.