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

Futures should not require a default constructor #863

Closed
eschnett opened this issue Sep 20, 2013 · 6 comments
Closed

Futures should not require a default constructor #863

eschnett opened this issue Sep 20, 2013 · 6 comments

Comments

@eschnett
Copy link
Contributor

future.hpp, line 248 says "return Result();". This requires a constructor that takes no arguments, which it shouldn't.

@K-ballo
Copy link
Member

K-ballo commented Sep 20, 2013

There are still pieces of code forcing the requirement of default constructibility for the result type.

@K-ballo K-ballo reopened this Sep 20, 2013
@K-ballo
Copy link
Member

K-ballo commented Sep 21, 2013

Closing as duplicate of the more general #865

@K-ballo K-ballo closed this as completed Sep 21, 2013
@ghost ghost assigned K-ballo Sep 21, 2013
@krivenko
Copy link

What was the actual resolution of this issue?
Are return types of actions supposed to be default constructible?

Here is an extended version of tests/unit/actions/return_future.cpp

https://gist.github.com/krivenko/9e61c80e6adf4cd375af239f723dc752

test_plain_call_future_non_default_ctor() fails to compile with the following errors,

hpx.git/hpx/util/tuple.hpp:72:24: error: use of deleted function ‘non_default_ctor::non_default_ctor()’
hpx.git/hpx/lcos/base_lco_with_value.hpp:85:22: error: use of deleted function ‘non_default_ctor::non_default_ctor()’

@K-ballo
Copy link
Member

K-ballo commented Aug 18, 2017

@krivenko

What was the actual resolution of this issue?

This issue was resolved, Future<R> no longer requires R to be DefaultConstructible.

Are return types of actions supposed to be default constructible?

It's possible, action parameters and return types do have extra requirements, and implicit unwrapping means a remote invocation of an action returning Future<R> is treated as if it returned just R. I'd suggest creating a dedicated issue with your extended test case, for visibility.

@hkaiser
Copy link
Member

hkaiser commented Aug 18, 2017

@krivenko I don't have a quick fix for this - sorry, please give me some time to think it over.

@hkaiser
Copy link
Member

hkaiser commented Aug 18, 2017

@krivenko: please see #2847

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants