
On Mon, 29 Nov 2010, Cedric Laczny wrote:
Hi,
I was wondering if there is a convenient (and to some extent intuitive) way to combine several predicates used in filtering a graph? The idea is to have some predicates defined and arbitrarily combine them so that the filtered_graph will check for compliance of each individual predicate and either make this vertex/edge visible or not. Of course, the predicates should be specific to vertices or edges, respectively, when being combined. When using std::vector or such, they would need to be all of the same type which does not seem very nice/feasible IMHO. Also defining a "big" predicate having a multitude of "smaller" predicates as members is not really an option as this is very restricted. Something like big_predicate = predicate1 || predicate2 || predicate3 (syntax should just illustrate the idea) maybe?
If you don't want to use Boost.Lambda, Boost.Bind also has some operators overloaded (URL:http://www.boost.org/doc/libs/1_45_0/libs/bind/bind.html#operators) to provide the syntax you wanted. -- Jeremiah Willcock