title: Using Boost Filter Iterator with non-Primitive Objects
body: <p>Lets say I have a returned iterator from Boost's Multi-Index, where each record contains an age and a name field.</p>
  
  <p>I get the iterator with </p>
  
  <pre><code>auto&amp; index = get&lt;age&gt;(m_records);
  auto ibegin = index.begin();
  auto iend = index.end();
  </code></pre>
  
  <p>How could I use this iterator with Boost's Filter Iterator so that I could return all records that, say have name = "John"?  </p>
  
  <p>I set up a struct for the predicate operator, I'm not sure if it's right:</p>
  
  <pre><code>struct name_equal_to {
        std::string struct_sname;
        bool operator()(ServerRecord x) { return x.get_name() == struct_sname; }
        name_equal_to(std::string in) : struct_sname(in){}
     };
  </code></pre>