2009/7/17 Robert Jones <robertgbjones@gmail.com>
On Fri, Jul 17, 2009 at 1:47 PM, Roman Perepelitsa <roman.perepelitsa@gmail.com> wrote:

std::for_each(v.begin(), v.end(), boost::mem_fn(&A::a)); 


Thanks Roman - I've missed a trick there!

Is that also equivalent to

for_each( v.begin(), v.end(), boost::bind(&A::a, _1));

Yes. Note that with boost::lambda::bind you would have to automatically extract a pointer from shared_ptr, but boost::bind does it for you.

Roman Perepelitsa.