Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch introduces
unique_function
(as an implementation detail), a counterpart tofunction
that is movable-only and can only be called once. By using it, we can finally support movable-only arguments to actions and as closures to executors.Breaking changes:
hpx::threads::thread_function_type
was changed fromthread_state_enum(thread_state_ex_enum)
, nowthread_function_sig
, tounique_function<thread_function_sig>
. Previous occurrences ofHPX_STD_FUNCTION<thread_function_type>
were replaced with justthread_function_type
, and adjustments were made as appropriate to avoid copying them.unique_function<void()>
, exposed asclosure_type
, instead ofHPX_STD_FUNCTION<void()>
. Adjustments were made as appropriate to avoid copying closures.The implementation of
unique_function
currently incurs a lot of duplicated code that could be shared withfunction
. Doing so, however, requires some drastic redesign of the virtual tables and how they are generated. It will nevertheless be provided by a future patch.