-
Code's Tags
-
Your Codes
-
Reffers
-
Linked Codes
|
Code:
Short link for Twitter:
HTML:
HTML view:
Copy Source | Copy HTML- template <class ForwardIterator, class T>
- ForwardIterator binary_find(ForwardIterator first, ForwardIterator last, const T& value){
- first = lower_bound(first,last,value);
- if (first!=last && !(value<*first)){
- if(*first==value) return first; //found
- else return last; // not found
- }else{
- return last; // not found
- }
- }
|