The interface for std::future::then
in the paper N3784 included an overloaded version that accepted an executor (described more here in N3562) as a parameter. So if you wanted more control over which thread the callback was executed on you could do so.
But the official document that goes over all the features that are in the concurrency TS here http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0159r0.html#futures.unique_future does not include that overload for .then() and doesn't mention executors at all. It says
When the object's shared state is ready, the continuation
INVOKE(DECAY_COPY(std::forward<F>(func))
,std::move(*this))
is called on an unspecified thread of execution with the call toDECAY_COPY()
being evaluated in the thread that called then.
Why does the interface not offer precise control of how the closure is executed? How then can one exercise control over which thread runs the callback? Why the change from the proposed version?
Note I am not sure if the concurrency TS paper I linked to is the latest one, but cppreference does not mention executor
s anywhere either
Edit If someone has a reference or reason in some C++ standards paper that mentions the reason for not continuing with executors, that would be great!