steve ahlgren
Hello all :
I have a filter_iterator question.
I'm wondering if, conceptualy, I can construct an FI doing something like the following :
typedef boost::filter_iterator< boost::bind( boost::mem_fn( &MyObject::HasQuality ), boost::ref( quality ) ), MyIterator > FilteredIterator;
You don't need mem_fn; bind will handle that implicitly. But sure, that'll work in principle. Just not in practice ;-). The problem is that you're putting a runtime expression in the template where a type is supposed to be. On the other hand, you could use make_filter_iterator to generate an appropriate iterator object. http://www.boost.org/libs/iterator/doc/filter_iterator.html#filter-iterator-... -- Dave Abrahams Boost Consulting www.boost-consulting.com