The map::lower_bound(k) is a built-in function in C++ STL which returns an iterator pointing to the key in the container which is equivalent to k passed in the parameter.
Parameters: This function accepts a single mandatory parameter key which specifies the element whose lower_bound is to be returned.
Return Value: The function returns an iterator pointing to the key in the map container which is equivalent to k passed in the parameter. In case k is not present in the map container, the function returns an iterator pointing to the immediate next element which is just greater than k. If the key passed in the parameter exceeds the maximum key in the container, then the iterator returned points to number of elements in the map as key and element=0.
1 10 2 30 4 40 5 50 The lower bound of key 2 is 2 30 The lower bound of key 3 is 4 40 The lower bound of key 6 is 4 0
- How to call some function before main() function in C++?
- Function Overloading vs Function Overriding in C++
- What happens when a virtual function is called inside a non-virtual function in C++
- Difference between Virtual function and Pure virtual function in C++
- div() function in C++
- log() function in C++
- exp() function C++
- fma() function in C++
- unordered_map end( ) function in C++ STL
- strcspn() function in C/C++
- array get() function in C++ STL
- array at() function in C++ STL
- iswspace() function in C/C++
- Modulus function in C++ STL
- transform_inclusive_scan() function 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 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.
Improved By : ChetanAggarwal