Hi Adam,

Sorry for the late answer... Thanks for that, I'm fine with this solution. If you still have problems or concerns about performance of type erasure maybe you could dig into how Boost.Function implements that without virtual function calls? Efficiency figures are presented here: http://www.boost.org/doc/libs/1_54_0/doc/html/function/misc.html#idp60516496. You could even have the predicates implemented in terms of Boost.Function which would de-facto make them type-erased instead of the whole iterator... Just a general thought though, if you happy with your implementation just keep it like this.

Thanks
Bruno