title: map.find implementation
body: <p>I'm trying to implement map.find myself, because I must to search among regexps.
  But my code works to long. Help plz. How can I improve the code? Can I add integer to iterator in other way? Built-in function works more than 10 times faster.</p>
  
  <pre><code>iterator find (string toFind)
  {
      iterator begin=mainMap.begin();
      int L=0;
      int R=mainMap.size();
      iterator M;
      while (L!=R)
      {
          M=begin;
          addition(&amp;M,((R+L)/2));
          if (match (&amp;(*M).first, &amp;toFind))
              return M;
          if (toFind&lt;(*M).first)
          {
              R=(R+L)/2;
          }
          else 
              L=(R+L)/2+1;
      }
      return mainMap.end();
  }
  
  void addition (iterator* it, int n)
  {
      for(int i=0;i&lt;n;i++, (*it)++)
      {
      }
  }
  
  bool match (const string* expression, const string* line)
  {
      return *expression==*line;
  }
  </code></pre>