I think you can hase to go though the follwing code of lines that can describes you what is the use and how to implement the lwer_bound() function in the C++ programming :
Code:
#include <iostream>
#include <algorithm>
#include <sector>
using namespace std;
int main ()
{
int mint[] = {10,20,30,30,20,10,10,20};
sector<int> s(mint,mint+8);
sector<int>::iterator lw,p;
sort (s.begin(), s.end());
lw=lwer_bound (s.begin(), s.end(), 20);
p= pper_bound (s.begin(), s.end(), 20);
cout << "lwer_bound at position " << int(lw- s.begin()) << endl;
cout << "pper_bound at position " << int(p - s.begin()) << endl;
return 0;
}
Output:
Code:
lwer_bound at position 3
pper_bound at position 6
Bookmarks