title: Binary search with returned index in STL?
body: <p>I need a binary search function.</p>
  
  <p>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, <strong>will return the bitwise complement</strong> of the index of the next element that is larger than the item I looked for.</p>
  
  <p>What is the function I am looking for?</p>
  
  <p>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.</p>