I have a feeling that a better reference might be the latest TS document (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4711.pdf) since that's more likely to be rigorously scrutinised and maintained.

defer and dispatch have this to say:

" 1 [ Note: The function defer satisfies the requirements for an asynchronous operation (13.2.7), except for the requirement that the operation uses post if it completes immediately. — end note ]"

which seems to suggest that defer and dispatch are allowed to invoke the completion handler immediately while post is not. Perhaps defer does a post unless the handler is a continuation? I think that would make sense.

R







On 5 January 2018 at 16:36, Vinnie Falco via Boost-users <boost-users@lists.boost.org> wrote:
On Fri, Jan 5, 2018 at 7:21 AM, Richard Hodges via Boost-users
<boost-users@lists.boost.org> wrote:
> When I had a query regarding the newer standalone boost, I emailed Chris
> directly. He very helpfully replied promptly and fully.

I emailed him too, several months ago, and this is what I got back:

    post() -> handler_is_continuation() == false
    defer() -> handler_is_continuation() == true

> Every piece of information you need is there, exactly once, with not even
> one character more than is necessary to aid understanding.

Yeah I know what you mean. It is quintessentially D.R.Y..

I'll note that Asio does not use defer() anywhere in its
implementation. I have not found any code which demonstrates its use.

Thanks
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
https://lists.boost.org/mailman/listinfo.cgi/boost-users