|
Boost Users : |
Subject: [Boost-users] [Bind] Retrun-type of bind expressions
From: Cedric Laczny (cedric.laczny_at_[hidden])
Date: 2010-11-30 12:38:30
Hello,
I am currently trying to find a way to conveniently combine different predicates
for a boost::filtered_graph.
boost::filtered_graph needs a specification of the template-arguments. Therefore
it important to know the return type of a bound expression.
I have read that actually the return type of bound expression is
"undeterminated" and one should rather use boost::function. However, I could
not come up with an idea to realize the following, either with bind or with
function:
using namespace boost;
// Both predicates are function objects: Default Constructible, Copy
Constructible and only having "template< class V > bool operator()( const V&
v)"
Pred1 pred1;
Pred2 pred2;
filtered_graph< MyGraph, keep_all, ?bind_return_type?> fg( g, keep_all(),
bind<bool>(pred1, _1) && bind<bool>(pred2, _1));
The question is now how to specify the bind_return_type, or how to do this
with boost::function?
Besides that, I hope that the logical combination (both predicates should
hold) and use of bind() in the example is correct?!
Best,
Cedric
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