20 Dec
2018
20 Dec
'18
6:13 a.m.
On Wed, Dec 19, 2018 at 9:37 PM Sorin Fetche
And this is what I have in mind: ... self.socket.async_read_some( read_buffer, asio::bind_executor( self.get_executor(), [self = std::move(self)](error_code ec, std::size_t bytes) mutable { if (!ec) { /* ... */ } else { self.user_completion_handler(ec, bytes); } }));
I sense danger here. The order of evaluation of function arguments is not defined. If the lambda is constructed first, then the call to `self.get_executor()` will be performed on a moved-from object. I could be wrong though... Regards