27 Jul
2011
27 Jul
'11
10:42 a.m.
It is possible t copy the value of error in a lambda external variable?
const boost::system::error_code myError; acceptor.async_accept(*socket,[&myError] (const boost::system::error_code &error) { myError = error; //??? } );
Yes, you can capture a global object by reference and modify it (if it non-const) inside a lambda. But this is realy out of boost scope. For details, please read the following: http://msdn.microsoft.com/en-us/library/dd293608.aspx http://msdn.microsoft.com/en-us/library/dd293603.aspx