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
Removing hpx::util::polymorphic_factory #1470
Changes from all commits
cf73d36
db00271
eb93bb0
8f75dfa
48cb976
8bcac71
8846488
55d42bc
884efb4
4e08f3e
5164a28
262a598
3a24621
b0e3c64
c077c17
b74b2ce
d4d983e
3196f67
a254882
532c1bf
1b38cc4
4174af4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,15 +4,16 @@ | |
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
// This is not demonstrating the recommended way of printing things to the | ||
// console - this can be done easily using hpx::cout instead. The purpose of | ||
// this example is to demonstrate how to use templated plain actions. | ||
// This is not demonstrating the recommended way of printing things to the | ||
// console - this can be done easily using hpx::cout instead. The purpose of | ||
// this example is to demonstrate how to use templated plain actions. | ||
|
||
#include <hpx/hpx_main.hpp> | ||
#include <hpx/include/actions.hpp> | ||
#include <hpx/include/async.hpp> | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
template <typename T> | ||
template <typename T> | ||
void print(T const& t) | ||
{ | ||
std::cout << t << "\n"; | ||
|
@@ -24,17 +25,14 @@ struct print_action | |
: hpx::actions::make_action<void (*)(T const&), &print<T>, print_action<T> > | ||
{}; | ||
|
||
HPX_REGISTER_PLAIN_ACTION_TEMPLATE((template <typename T>), (print_action<T>)); | ||
|
||
// define a direct action which is semantically equivalent to the plain action | ||
// above | ||
template <typename T> | ||
struct print_direct_action | ||
: hpx::actions::make_direct_action<void (*)(T const&), &print<T>, print_direct_action<T> > | ||
: hpx::actions::make_direct_action< | ||
void (*)(T const&), &print<T>, print_direct_action<T> > | ||
{}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please try to limit line length to approx. 80 characters. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There should be no need for accessing the nested There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's true in other places as well (see changes to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the record, I don't mind the change (in fact I slightly prefer it due to compiler internals and other unimportant details). However, this pattern is used all over the place and is even documented for users to leverage, so I just want to make sure that it isn't broken now. Secondarily, I'd like both a rationale for the change, and it being applied consistently. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not really necessary. I needed to do that change during development and forgot to revert. Action access with nested |
||
|
||
HPX_REGISTER_PLAIN_ACTION_TEMPLATE((template <typename T>), (print_direct_action<T>)); | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
int main() | ||
{ | ||
|
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.
Is there still a way to identify plain actions for selecting localities supporting them?
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.
No, since all plain actions have the same component type, this is not possible with those changes. Is this something we really need?