
On Mon, 22 Feb 2010 20:51:58 -0800
Steven Watanabe
Manfred Doudar wrote:
Hi,
using namespace boost::mpl;
typedef vector
vec; Func f; Object instance; for_each<vec>(boost::bind(&Func::operator()
, boost::ref(f), instance) );
Question is, what goes in at XXX above?
I was thinking something along the lines of:
boost::mpl::bindboost::mpl::_1
..but well, that doesn't work.
Try passing an argument of type M or R as a parameter:
template
void operator()(const T&, U& u) const { T::foo(); } ... for_each<vec>(boost::bind(boost::ref(f), _1, instance))
To both Steven & Rutger who answered - a short note of thanks. I was indeed aware of resloving the problem with the above mentioned approach, but was hoping for an explicit invocation of some kind without having to make use of a superfluous tag T in the parameter list. ..No matter. With thanks again to Steven and Rutger. Cheers, -- Manfred