I need a binary search function.
I couldn\'t find any function in the standard library that will return the index of the found item, and if it wasn\'t found,
I'm quite certain the standard library doesn't include anything to do precisely what you're asking for.
To get what you want, you'll probably want to start from std::lower_bound
or std::upper_bound
, and convert the iterator it returns into an index, then complement the index of the value wasn't found.