
Thanx for the reply.
If by dereferencing the pointer you mean
for_each(shapes.begin(), shapes.end(), bind(&shape::draw, *_1, 2));
then I get another error - cannot instantiate abstract class.
Plus I would expect the dereferencing to slice off the derived bits of
circle and rectangle.
Regards
Brian Martin
On Wed, Jun 9, 2010 at 2:42 AM, Steven Watanabe
AMDG
Brian Martin wrote:
class shape { public: virtual void draw(const int)=0; };
<snip>
vector< shared_ptr<shape> > shapes;
// assume I stick stuff into shapes...
for_each(shapes.begin(), shapes.end(), bind(&shape::draw, _1, 2));
The last statement fails under VC++ 2008 with error C2665: 'boost::lambda::function_adaptor<Func>::apply' : none of the 2 overloads could convert all the argument types
Dereferencing the pointer should work with the current trunk.
In Christ, Steven Watanabe
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users