
14 Oct
2011
14 Oct
'11
7:46 p.m.
Robert Jones wrote: ...
void task( int );
vector<int> v; v += 1,2,3,4,5,6,7,8,9; pool my_pool;
for_each( v.begin( ), v.end( ), bind( schedule, my_pool, _1 ) );
The easiest solution would be for you to define void my_schedule( pool & my_pool, int k ) { schedule( pool, boost::bind( task, k ) ); } and then use my_schedule above (you'll need ref(my_pool) though.) Or, you could bind &pool::schedule directly, without going via the schedule convenience wrapper: bind( &pool::schedule, &my_pool, protect( bind( task, _1 ) ) )