title: boost Filter iterator with different predicates
body: <p>I'm trying to implement a method which returns a boost::filter_iterator pair (begin, end).</p>
  
  <p>I would like this method to be customizable in terms of filtering, but I don't know how I could sort this out since when I typedef the filter iterator range I have to hardcode the predicate I want to use and I cannot choose it depending on the parameter the method receives in input.</p>
  
  <p>I would like to have something like this :</p>
  
  <pre><code>enum FilterType
  {
      FilterOnState = 0,
      FilterOnValue,
      FilterOnSize,
      FilterOnWhatever...
  }
  
  typedef boost::filter_iterator&lt;PredicateStruct, std::list&lt;Object&gt;::iterator&gt; filter_iterator;
  
  std::pair&lt;filter_iterator, filter_iterator&gt; filterObjects(FilterType filterType);
  </code></pre>
  
  <p>I thought about a possible template solution as well, but I would need the client to access predicates implementation and instance the one suiting his needs before calling the filter, he'd almost do all the job himself : that's why I'd like best the enum based solution.</p>
  
  <pre><code>template&lt;typename P&gt;
  std::pair&lt;boost::filter_iterator&lt;P, std::list&lt;Object&gt;::iterator&gt;, 
            boost::filter_iterator&lt;P, std::list&lt;Object&gt;::iterator&gt;&gt; filterObjects(P&amp; predicate);
  </code></pre>
  
  <p>Would a predicate "base class" be a possible solution for the enum based implementation ?</p>
  
  <p>Thanks a lot in advance!
  Giacomo</p>