![]() |
Data Abstraction and Problem Solving with C++Walls and Mirrorsby Frank M. Carrano |
![]() |
c10p576.hGo to the documentation of this file.00001 00015 bool binary_search(ForIter first, ForIter last, const T& value); 00016 bool binary_search(ForIter first, ForIter last, const T& value, 00017 Compare cmp); 00018 // Returns true if value appears in the sorted range 00019 // from first to last. 00020 // Returns false if value is not found. 00021 // A comparison function object may be supplied. 00022 00023 ForIter lower_bound(ForIter first, ForIter last, const T& value); 00024 ForIter lower_bound(ForIter first, ForIter last, const T& value, 00025 Compare cmp); 00026 // Returns an iterator pointing to the first occurrence of value 00027 // in the sorted range from first to last. 00028 // Returns last if value is not found. 00029 // A comparison function object may be supplied. 00030 00031 ForIter upper_bound(ForIter first, ForIter last, const T& value); 00032 ForIter upper_bound(ForIter first, ForIter last, const T& value, 00033 Compare cmp); 00034 // Returns an iterator pointing to one past the last occurrence 00035 // of value in the sorted range from first to last. 00036 // Returns last if value is not found. 00037 // A comparison function object may be supplied. 00038 00039 pair<ForIter, ForIter> equal_range(ForIter first, ForIter last, 00040 const T& value); 00041 pair<ForIter, ForIter> equal_range(ForIter first, ForIter last, 00042 const T& value, Compare cmp); 00043 // Combines lower_bound and upper_bound to return a pair 00044 // of iterators to the first and one past the last occurrences 00045 // of value. 00046 // Both iterators point to last if value is not found. 00047 // A comparison function object may be supplied. |