- template <class ForwarIterator, class T>
- bool binary_search(ForwardIterator first, ForwardIterator last, const T& value) {
- ForwardIterator i = lower_bound(first, last, value);
- return i != last && !(value < *i);
- }
转载于:https://blog.51cto.com/zxn990/1172929