
If I change it to std::function<void(const boost::system::error_code &error)> callback = ... then the connection is not passed. If it is not passed, then there is no way to store it, change its state, etc. It is passed in the tutorial code, so why can't I pass it with std::function? On Wed, Mar 29, 2017 at 12:56 AM, TONGARI J via Boost-users < boost-users@lists.boost.org> wrote:
2017-03-29 11:28 GMT+08:00 Christopher Pisz via Boost-users < boost-users@lists.boost.org>:
Exact source listing in Visual Studio 2015
[...]
Exact output spew from compilation: This is against boost 1.55, because that's what I have at home. I use 1.62.0 at work and get the exact same errors.
Change ``` std::function<void(tcp_connection::pointer new_connection, const boost::system::error_code &error)> callback = ... ``` To: ``` std::function<void(const boost::system::error_code &error)> callback = ... ```
BTW, I'd recommend using lambda exprs instead of bind in most cases.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users