lower_bound

ソート済みシーケンスにおいて、指定された範囲に指定した値と同じか、それ以上の値が出現する場所のフォーワードイテレータを返します。

lower_bound のサンプルコード

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
  vector<char> v;
  vector<char>::iterator i;

  for (int j = 0; j < 26; ++j) {
    v.push_back('A' + j);
  }

  i = lower_bound(v.begin(), v.end(), 'M');

  while (i != v.end()) {
    cout << *i;
    ++i;
  }
  cout << endl;

  return 0;
}

実行結果は次の通りです。

./a.out
MNOPQRSTUVWXYZ