You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today we encountered conversion-errors when trying to chain actions with different input and output types. Let me illustrate the issue with a short example:
boost::int32_ttimes2(boost::int32_t i) { return i * 2; }
HPX_PLAIN_ACTION(times2); // defines times2_action
std::string my_to_string(boost::int32_t i) { returnstd::to_string(i); }
HPX_PLAIN_ACTION(my_to_string); // defines to_string_action
boost::int32_t result = hpx::async_continue(
times2_action(),
hpx::make_continuation(my_to_string_action()),
hpx::find_here(),
42).get();
hpx::cout << result << std::endl; // will print: 3422212
Clearly the actions can be called in the given sequence, but the result should be std::string and not boost::int32_t and it should print 84.
Please provide a way to chain actions where input and output have different types.
The text was updated successfully, but these errors were encountered:
Mitigation requires an action that consumes hpx::future, as it seems that then requires the next action to consume futures while hpx::make_continuation does not.
boost::int32_ttimes2(boost::int32_t i) { return i * 2; }
HPX_PLAIN_ACTION(times2); // defines times2_action
std::string my_to_string(hpx::future<boost::int32_t> i) { returnstd::to_string(i); }
HPX_PLAIN_ACTION(my_to_string); // defines to_string_action
std::string result = hpx::async(times2_action(), hpx::find_here(), 42).then(
hpx::util::bind(my_to_string_action(),
hpx::find_here(),
hpx::util::placeholders::_1)).get();
hpx::cout << result << std::endl; // will print: 84
Today we encountered conversion-errors when trying to chain actions with different input and output types. Let me illustrate the issue with a short example:
Clearly the actions can be called in the given sequence, but the result should be
std::string
and notboost::int32_t
and it should print 84.Please provide a way to chain actions where input and output have different types.
The text was updated successfully, but these errors were encountered: