结论:
若对容器采用,返回值为vector.end();
测试如下:
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <vector>
using namespace std;
int main(int argc, char *argv[])
{
vector<int> a={1,2,3,4,5,7,8,9};
printf("%d\n",lower_bound(a.begin(),a.end(),100) - a.begin());
printf("%d\n",lower_bound(a.begin(),a.end(),80000) - a.begin());
printf("%d\n",lower_bound(a.begin(),a.end(),9) - a.begin());
printf("%d\n",a.end()- a.begin());
printf("%d\n",a[7]);
}
8
8
7
8
9