13 Asynchronous model [async]

13.18 Class system_executor [async.system.exec]

13.18.1 system_executor operations [async.system.exec.ops]

system_context& context() const noexcept;

Returns: A reference to an object with static storage duration. All calls to this function return references to the same object.

template<class Func, class ProtoAllocator> void dispatch(Func&& f, const ProtoAllocator& a) const;

Effects: Equivalent to DECAY_COPY(forward<Func>(f))() (C++ 2014 [thread.decaycopy]).

template<class Func, class ProtoAllocator> void post(Func&& f, const ProtoAllocator& a) const; template<class Func, class ProtoAllocator> void defer(Func&& f, const ProtoAllocator& a) const;

Effects: If context().stopped() is false, creates an object f1 initialized with DECAY_COPY(forward<Func>(f)), and calls f1() as if in a thread of execution represented by a thread object. Any exception propagated from the execution of DECAY_COPY(forward<Func>(f))() results in a call to std::terminate.