$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-users] Using vectors of ptrs
From: Robert Jones (robertgbjones_at_[hidden])
Date: 2009-07-17 08:40:55
Hi All
Here's a quickie for you....
Given
struct A { void a(); };
type std::vector<boost::shared_ptr<A> > VecType;
VecType v;
for (VecType::iterator i=v.begin(); i != v.end(); ++i )
(*i)->a();
How can I write that as a for_each loop?
for_each( v.begin(), v.end(), boost::bind( ????? ) );
Thanks,
- Rob.
ps I can't use lambda because boost.bind is already used, and the
placeholder name
collisions just aren't worth the pain.