Boost logo

Boost Users :

From: steve ahlgren (steveahlgren_at_[hidden])
Date: 2005-03-22 16:31:32


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;

Instead of defining an explicit functor like this :

struct MyFunctor
{
bool operator()( const MyObject& obj ) const
{ etc }
};

and the FI like this :
typedef boost::filter_iterator< MyFunctor, MyIterator > FilteredIterator;

Gosh! Writing functors is flipping waste of time! Has anyone used
the former construct instead?

Thanks in advance!
SGA


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net