$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Peter Dimov (pdimov_at_[hidden])
Date: 2007-12-28 13:34:24
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.