...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Let Args...
be the argument types of the completion signature
Signature
and let N
be sizeof...(Args)
. Let i
be in the range [0
,N
).
Let T[sub i
] be the i
th
type in Args...
and let t[sub i
]
be the i
th completion handler argument
associated with T[sub i
].
Let f
be a function object, callable as f()
,
that invokes completion_handler
as if by completion_handler(forward<T[sub
0
>(t[sub 0]), ...,
forward<T[sub N-1]>(t[sub N-1]))].
If an asynchonous operation completes immediately (that is, within the
thread of execution calling the initiating function, and before the initiating
function returns), the completion handler shall be submitted for execution
as if by performing ex2.post(std::move(f), alloc2)
. Otherwise,
the completion handler shall be submitted for execution as if by performing
ex2.dispatch(std::move(f), alloc2)
.