Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unique function #1130

Merged
merged 4 commits into from
May 12, 2014
Merged

Unique function #1130

merged 4 commits into from
May 12, 2014

Conversation

K-ballo
Copy link
Member

@K-ballo K-ballo commented May 11, 2014

This patch introduces unique_function (as an implementation detail), a counterpart to function 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 from thread_state_enum(thread_state_ex_enum) , now thread_function_sig, to unique_function<thread_function_sig>. Previous occurrences of HPX_STD_FUNCTION<thread_function_type> were replaced with just thread_function_type, and adjustments were made as appropriate to avoid copying them.
  • Executors were changed to use unique_function<void()>, exposed as closure_type, instead of HPX_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 with function. 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.

@StellarBot
Copy link

Tests Failed.
Refer to this link for build results: http://hermione.cct.lsu.edu:5632/job/hpx_pr_debug_gcc_44_boost_1_55_0/10/

@hkaiser
Copy link
Member

hkaiser commented May 11, 2014

The failing tests are unrelated to the given patch

@hkaiser hkaiser added this to the 0.9.9 milestone May 12, 2014
hkaiser added a commit that referenced this pull request May 12, 2014
@hkaiser hkaiser merged commit 8a6c088 into master May 12, 2014
@hkaiser hkaiser deleted the unique_function branch June 3, 2014 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants