|
Boost Users : |
From: Xiaofan Li (mr.xiaofan.li_at_[hidden])
Date: 2007-12-31 12:49:24
Solved my problem precisely.
-- Xiaofan Li On Fri, 2007-12-28 at 20:34 +0200, Peter Dimov wrote: > Xiaofan Li: > > ... > > > for (int i = 0; i < 10; ++i) > > threads.create_thread( boost::bind( boost::mem_fn( > > &threaded::increment_count ), &_thrd, a ) ); > > Use > > boost::bind( &threaded::increment_count, &_thrd, boost::ref( a ) ) > > to make boost::bind store a reference to 'a', rather than a copy. > _______________________________________________ > Boost-users mailing list > Boost-users_at_[hidden] > http://lists.boost.org/mailman/listinfo.cgi/boost-users
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net