Commit aa0ff417 authored by Dominik Charousset's avatar Dominik Charousset

fixed forwarding of become() args

parent 1823f1c9
......@@ -679,9 +679,14 @@ inline void send_exit(actor_ptr whom, std::uint32_t reason) {
* unless {@link keep_behavior} is given as first argument.
*/
template<typename T, typename... Ts>
inline void become(T arg, Ts&&... args) {
self->do_become(match_expr_convert(arg, std::forward<Ts>(args)...), true);
//become(std::forward<Ts>(args)...);
inline typename std::enable_if<
!is_behavior_policy<typename util::rm_const_and_ref<T>::type>::value,
void
>::type
become(T&& arg, Ts&&... args) {
self->do_become(match_expr_convert(std::forward<T>(arg),
std::forward<Ts>(args)...),
true);
}
template<bool Discard, typename... Ts>
......
......@@ -65,6 +65,12 @@ class sync_handle_helper;
template<bool DiscardBehavior>
struct behavior_policy { static constexpr bool discard_old = DiscardBehavior; };
template<typename T>
struct is_behavior_policy : std::false_type { };
template<bool DiscardBehavior>
struct is_behavior_policy<behavior_policy<DiscardBehavior>> : std::true_type { };
typedef behavior_policy<false> keep_behavior_t;
typedef behavior_policy<true > discard_behavior_t;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment