$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Peter Dimov (pdimov_at_[hidden])
Date: 2006-09-15 16:17:51
Alexander Shyrokov wrote:
> I have a map<int,c*> and I would like to call a member function of the
> c* and provide a parameter to it.
>
> struct c{void f(char*){}};
> typedef std::map<int,c*> TMap;
> TMap a;
> std::for_each(a.begin(),a.end(),boost::bind(&c::f,boost::bind(&TMap::value_type::second,_1)),NULL);
You have
std::for_each( a.begin(), a.end(),
boost::bind( &c::f,
boost::bind( &TMap::value_type::second, _1 )
),
NULL
);
but you need
std::for_each( a.begin(), a.end(),
boost::bind( &c::f,
boost::bind( &TMap::value_type::second, _1 ),
NULL
)
);