#include <iostream>
#include <vector>
#include <algorithm>
using
namespace
std;
int
main()
{
vector<
int
> v = { 1, 2, 3, 4, 5, 5, 6, 7 };
std::pair<std::vector<
int
>::iterator,
std::vector<
int
>::iterator> ip;
ip = std::equal_range(v.begin(), v.end(), 5);
cout <<
"std::lower_bound should be equal to "
<< (ip.first - v.begin()) <<
" and std::upper_bound "
<<
"should be equal to "
<< (ip.second - v.begin());
vector<
int
>::iterator i1, i2;
i1 = std::lower_bound(v.begin(), v.end(), 5);
cout <<
"\nstd::lower_bound is = "
<< (i1 - v.begin());
i2 = std::upper_bound(v.begin(), v.end(), 5);
cout <<
"\nstd::upper_bound is = "
<< (i2 - v.begin());
return
0;
}