The thread
constructor copies its arguments, and the message
type is not copyable. To pass a reference to the target function you need to use boost::ref(msg)
Also note that using bind
with thread
is unnecessary:
boost::thread thrd(&handover_request_handler, boost::ref(msg), boost::ref(ec));
The thread
constructor implements the same semantics as bind
, so using bind
just adds unnecessary additional copying.