Source Code for Me (s-c.me)

Allows you to paste souce code to blogs! Adapted for Twitter! Here is Search Form in case you missed your code.
Code:
Selected Language:
Show Linenumbers:
Short link for Twitter:
HTML:

HTML view:

Copy Source | Copy HTML
  1. template <class ForwardIterator, class T>
  2. ForwardIterator binary_find(ForwardIterator first, ForwardIterator last, const T& value){
  3.     first = lower_bound(first,last,value);
  4.     if (first!=last && !(value<*first)){
  5.         if(*first==value) return first; //found
  6.         else return last; // not found
  7.     }else{
  8.         return last; // not found
  9.     }
  10. }




Based on Manoli.Net's CodeFormatter. Made by Topbot (c) 2008-2012