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, will return the bitwise complement of the index of the next element that is larger than the item I looked for.
What is the function I am looking for?
Edit: I need to insert an item to a sorted vector and to keep it sorted. That's why I need to bitwise complement index.