title: STL algorithms and const_iterators
body: <p>Today I wrote a small predicate to find matching symbols in a container.</p>
  
  <p>But I'm faced to a problem: I want to use this predicate in a <code>std::find_if</code> call inside a const-method of a class, searching in a container that is a member of this class.</p>
  
  <p>But I just noticed that neither <code>std::find</code> nor <code>std::find_if</code> are able to operate on <code>const_iterators</code> !</p>
  
  <p>I checked on some C++ references and it seems there is no version of <code>std::find</code> or <code>std::find_if</code> that accept/return <code>const_iterators</code>. I just can't understand why, since from what I've seen, there is no way that these algorithms could modify the object referenced by the iterator.</p>
  
  <p>Here is how is documented <code>std::find</code> in the SGI implementation:</p>
  
  <blockquote>
    <p>Returns the first iterator i in the
    range [first, last) such that *i ==
    value. Returns last if no such
    iterator exists.</p>
  </blockquote>