Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the iterator for a successful binary_search? [duplicate]

I want to get the iterator for the element I'm testing for in binary-search. But it only returns a bool indicating whether it found the value or not. How to get the iterator?

like image 458
nakiya Avatar asked Nov 22 '10 05:11

nakiya


1 Answers

You want either lower_bound, upper_bound, or equal_range.

like image 193
CTT Avatar answered Oct 01 '22 21:10

CTT