-
-
Notifications
You must be signed in to change notification settings - Fork 423
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
Allowing component clients as action return types #2184
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright (c) 2007-2014 Hartmut Kaiser | ||
// Copyright (c) 2011 Bryce Lelbach | ||
// Copyright (c) 2011 Thomas Heller | ||
// | ||
// Distributed under the Boost Software License, Version 1.0. (See accompanying | ||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
|
||
#ifndef HPX_TRAITS_ACTION_REMOTE_RESULT_HPP | ||
#define HPX_TRAITS_ACTION_REMOTE_RESULT_HPP | ||
|
||
namespace hpx { namespace traits | ||
{ | ||
namespace detail | ||
{ | ||
template <typename Result, typename Enable = void> | ||
struct action_remote_result_customization_point | ||
{ | ||
typedef Result type; | ||
}; | ||
} | ||
|
||
template <typename Result> | ||
struct action_remote_result | ||
: detail::action_remote_result_customization_point<Result> | ||
{}; | ||
}} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
|
||
set(tests | ||
moveonly_constructor_arguments_1405 | ||
returned_client_2150 | ||
) | ||
|
||
foreach(test ${tests}) | ||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we decay in the static_cast as well? It's about the correct dynamic type of the continuation, not how the argument is passed to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately that will not work. If Arg0 is a const&, a static_cast to the decayed type will fail compiling as the trigger_value will expect a pure rvalue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure I understand the issue here completely. The dynamic cast fails if the type is not decayed, that means that the dynamic type is with the decayed type, right?
On the other hand, the compilation fails when using the static_cast with the decayed type?
This sounds like there is something very fishy going on there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's difficult to explain. Let's assume
Arg0
is deduced asid_type const&
. In this case, thedynamic_cast<Arg0>(this)
would fail asthis
is not of typetyped_continuation<id_type const&>
but of typetyped_continuation<id_type>
. Hence the decayed argument.At the same time, if we statically casted
this
totyped_continuation<id_type>
, then its member functiontrigger_value
effectively would have the signaturetrigger_value(id_type&&)
causing compilation problems (remember,trigger_value
is a virtual function and we have no way to use a forwarding reference here - which would solve the issue).One solution would be to have another virtual function
trigger_value(Result const&)
which would be used by the compiler in this case. Adding this however causes issues wheneverArg0
represents a move-only type (we can't 'disable' the virtual function from the type for this case).This code is fishy as it does a
static_cast<typed_continuation<id_type const&>>(this)
wherethis
is actually atyped_continuation<id_type>
. This however should not be a problem as for both types the effectively generated class is 100% identical in layout and member function signatures.Please let me know if you have any other suggestion on how to resolve the problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yuck...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what I said.
this
points to an object of that type.That does not work if the function is called with a
const&
, didn't I mention that?The easiest would be if you changed the static_cast to use the decayed type yourself. That would demonstrate the problem right away.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, it most likely will complain. But you could tell it to ignore this instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you decay copy, everything works, here is the patch that works for me:
https://gist.github.com/sithhell/7c4f73280b236662e448b571a9218030
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, thanks.