
Nico Galoppo
I'm having trouble getting make_filter_iterator and bind to work together nicely:
------------------------------------------------------------------------------- boost::function
is_constraint; is_constraint = boost::bind(&node_type::IsConstraint, _1); boost::make_filter_iterator(is_constraint, ab.begin(), ab.end()); // ERROR: does not compile boost::make_filter_iterator(boost::bind(&node_type::IsConstraint, _1), ab.begin(), ab.end()); // compiles -------------------------------------------------------------------------------
Note that ab.begin()/ab.end() return iterators to containers of shared pointers. See below for compiler errors.
It's actually not bind, but function. Bind contains magic that treats
shared_ptr<T> and T& the same way, but for function to take advantage
of that magic, you need to make sure its argument type is
shared_ptr<T>, not T&:
boost::function
Reason: cannot convert from 'Hybrid::Graph
::const_node_ptr' to 'const node_type' with [ node_traits=ArticulatedModelNodeTraits<MyTypes> ]
HTH, -- Dave Abrahams Boost Consulting www.boost-consulting.com