Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] Searching for a convenient way to combine predicates for filtered_graph
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2010-11-30 10:57:17


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


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