Commit bddecb9c authored by Dominik Charousset's avatar Dominik Charousset

Coding style nitpicks

parent b950901e
......@@ -59,9 +59,9 @@ class behavior {
* The list of arguments can contain match expressions, message handlers,
* and up to one timeout (if set, the timeout has to be the last argument).
*/
template <class V, class... Vs>
behavior(V v, Vs... vs) {
assign(std::move(v), std::move(vs)...);
template <class T, class... Ts>
behavior(T x, Ts... xs) {
assign(std::move(x), std::move(xs)...);
}
/**
......@@ -75,10 +75,10 @@ class behavior {
/**
* Assigns new handlers.
*/
template <class... Vs>
void assign(Vs... vs) {
static_assert(sizeof...(Vs) > 0, "assign() called without arguments");
m_impl = detail::make_behavior(vs...);
template <class... Ts>
void assign(Ts... xs) {
static_assert(sizeof...(Ts) > 0, "assign() called without arguments");
m_impl = detail::make_behavior(xs...);
}
void assign(intrusive_ptr<detail::behavior_impl> ptr) {
......
......@@ -237,12 +237,12 @@ class blocking_actor::functor_based : public blocking_actor {
using act_fun = std::function<void(blocking_actor*)>;
template <class F, class... Ts>
functor_based(F f, Ts&&... vs) {
functor_based(F f, Ts&&... xs) {
using trait = typename detail::get_callable_trait<F>::type;
using arg0 = typename detail::tl_head<typename trait::arg_types>::type;
blocking_actor* dummy = nullptr;
std::integral_constant<bool, std::is_same<arg0, blocking_actor*>::value> tk;
create(dummy, tk, f, std::forward<Ts>(vs)...);
create(dummy, tk, f, std::forward<Ts>(xs)...);
}
void cleanup(uint32_t reason);
......@@ -254,13 +254,13 @@ class blocking_actor::functor_based : public blocking_actor {
void create(blocking_actor*, act_fun);
template <class Actor, typename F, class... Ts>
void create(Actor* dummy, std::true_type, F f, Ts&&... vs) {
create(dummy, std::bind(f, std::placeholders::_1, std::forward<Ts>(vs)...));
void create(Actor* dummy, std::true_type, F f, Ts&&... xs) {
create(dummy, std::bind(f, std::placeholders::_1, std::forward<Ts>(xs)...));
}
template <class Actor, typename F, class... Ts>
void create(Actor* dummy, std::false_type, F f, Ts&&... vs) {
std::function<void()> fun = std::bind(f, std::forward<Ts>(vs)...);
void create(Actor* dummy, std::false_type, F f, Ts&&... xs) {
std::function<void()> fun = std::bind(f, std::forward<Ts>(xs)...);
create(dummy, [fun](Actor*) { fun(); });
}
......
......@@ -28,21 +28,21 @@
namespace caf {
/**
* Checks whether `R` does support an input of type `{Ls...}` via a
* Checks whether `R` does support an input of type `{Ts...}` via a
* static assertion (always returns 0).
*/
template <class... Rs, class... Ls>
void check_typed_input(const typed_actor<Rs...>&,
const detail::type_list<Ls...>&) {
template <class... Sigs, class... Ts>
void check_typed_input(const typed_actor<Sigs...>&,
const detail::type_list<Ts...>&) {
static_assert(detail::tl_find<
detail::type_list<Ls...>,
detail::type_list<Ts...>,
atom_value
>::value == -1,
"atom(...) notation is not sufficient for static type "
"checking, please use atom_constant instead in this context");
static_assert(detail::tl_find_if<
detail::type_list<Rs...>,
detail::input_is<detail::type_list<Ls...>>::template eval
detail::type_list<Sigs...>,
detail::input_is<detail::type_list<Ts...>>::template eval
>::value >= 0,
"typed actor does not support given input");
}
......
......@@ -31,8 +31,8 @@ namespace detail {
// this utterly useless function works around a bug in Clang that causes
// the compiler to reject the trailing return type of apply_args because
// "get" is not defined (it's found during ADL)
template<long Pos, class... Vs>
typename tl_at<type_list<Vs...>, Pos>::type get(const type_list<Vs...>&);
template<long Pos, class... Ts>
typename tl_at<type_list<Ts...>, Pos>::type get(const type_list<Ts...>&);
template <class F, long... Is, class Tuple>
auto apply_args(F& f, detail::int_list<Is...>, Tuple&& tup)
......@@ -40,22 +40,22 @@ auto apply_args(F& f, detail::int_list<Is...>, Tuple&& tup)
return f(get<Is>(tup)...);
}
template <class F, class Tuple, class... Vs>
auto apply_args_prefixed(F& f, detail::int_list<>, Tuple&, Vs&&... vs)
-> decltype(f(std::forward<Vs>(vs)...)) {
return f(std::forward<Vs>(vs)...);
template <class F, class Tuple, class... Ts>
auto apply_args_prefixed(F& f, detail::int_list<>, Tuple&, Ts&&... xs)
-> decltype(f(std::forward<Ts>(xs)...)) {
return f(std::forward<Ts>(xs)...);
}
template <class F, long... Is, class Tuple, class... Vs>
auto apply_args_prefixed(F& f, detail::int_list<Is...>, Tuple& tup, Vs&&... vs)
-> decltype(f(std::forward<Vs>(vs)..., get<Is>(tup)...)) {
return f(std::forward<Vs>(vs)..., get<Is>(tup)...);
template <class F, long... Is, class Tuple, class... Ts>
auto apply_args_prefixed(F& f, detail::int_list<Is...>, Tuple& tup, Ts&&... xs)
-> decltype(f(std::forward<Ts>(xs)..., get<Is>(tup)...)) {
return f(std::forward<Ts>(xs)..., get<Is>(tup)...);
}
template <class F, long... Is, class Tuple, class... Vs>
auto apply_args_suffxied(F& f, detail::int_list<Is...>, Tuple& tup, Vs&&... vs)
-> decltype(f(get<Is>(tup)..., std::forward<Vs>(vs)...)) {
return f(get<Is>(tup)..., std::forward<Vs>(vs)...);
template <class F, long... Is, class Tuple, class... Ts>
auto apply_args_suffxied(F& f, detail::int_list<Is...>, Tuple& tup, Ts&&... xs)
-> decltype(f(get<Is>(tup)..., std::forward<Ts>(xs)...)) {
return f(get<Is>(tup)..., std::forward<Ts>(xs)...);
}
} // namespace detail
......
......@@ -194,53 +194,53 @@ struct join_std_tuples<T> {
using type = T;
};
template <class... Ts, class... Us, class... Rs>
struct join_std_tuples<std::tuple<Ts...>, std::tuple<Us...>, Rs...>
: join_std_tuples<std::tuple<Ts..., Us...>, Rs...> {
template <class... Prefix, class... Infix, class... Suffix>
struct join_std_tuples<std::tuple<Prefix...>, std::tuple<Infix...>, Suffix...>
: join_std_tuples<std::tuple<Prefix..., Infix...>, Suffix...> {
// nop
};
// this function reorganizes its arguments to shift the timeout definition
// to the front (receives it at the tail)
template <class R, class F, class... Vs>
intrusive_ptr<R> make_behavior_ra(timeout_definition<F>& tdef,
tail_argument_token&, Vs... vs) {
return make_behavior_eor<R>(std::tuple_cat(to_match_case_tuple(vs)...), tdef);
template <class R, class F, class... Ts>
intrusive_ptr<R> make_behavior_ra(timeout_definition<F>& td,
tail_argument_token&, Ts... xs) {
return make_behavior_eor<R>(std::tuple_cat(to_match_case_tuple(xs)...), td);
}
template <class R, class... Vs>
intrusive_ptr<R> make_behavior_ra(tail_argument_token&, Vs... vs) {
return make_behavior_eor<R>(std::tuple_cat(to_match_case_tuple(vs)...));
template <class R, class... Ts>
intrusive_ptr<R> make_behavior_ra(tail_argument_token&, Ts... xs) {
return make_behavior_eor<R>(std::tuple_cat(to_match_case_tuple(xs)...));
}
// for some reason, this call is ambigious on GCC without enable_if
template <class R, class V, class... Vs>
template <class R, class V, class... Ts>
typename std::enable_if<
!std::is_same<V, tail_argument_token>::value,
intrusive_ptr<R>
>::type
make_behavior_ra(V& v, Vs&... vs) {
return make_behavior_ra<R>(vs..., v);
make_behavior_ra(V& v, Ts&... xs) {
return make_behavior_ra<R>(xs..., v);
}
// this function reorganizes its arguments to shift the timeout definition
// to the front (receives it at the tail)
template <class... Vs>
template <class... Ts>
intrusive_ptr<
default_behavior_impl<
typename join_std_tuples<
typename lift_to_mctuple<Vs>::type...
typename lift_to_mctuple<Ts>::type...
>::type
>>
make_behavior(Vs&... vs) {
make_behavior(Ts&... xs) {
using result_type =
default_behavior_impl<
typename join_std_tuples<
typename lift_to_mctuple<Vs>::type...
typename lift_to_mctuple<Ts>::type...
>::type
>;
tail_argument_token eoa;
return make_behavior_ra<result_type>(vs..., eoa);
return make_behavior_ra<result_type>(xs..., eoa);
}
using behavior_impl_ptr = intrusive_ptr<behavior_impl>;
......
......@@ -570,12 +570,12 @@ class default_uniform_type_info : public detail::abstract_uniform_type_info<T> {
std::vector<uniform_type_info_ptr> m_members;
};
template <class... Rs>
class default_uniform_type_info<typed_actor<Rs...>> :
public detail::abstract_uniform_type_info<typed_actor<Rs...>> {
template <class... Sigs>
class default_uniform_type_info<typed_actor<Sigs...>> :
public detail::abstract_uniform_type_info<typed_actor<Sigs...>> {
public:
using super = detail::abstract_uniform_type_info<typed_actor<Rs...>>;
using handle_type = typed_actor<Rs...>;
using super = detail::abstract_uniform_type_info<typed_actor<Sigs...>>;
using handle_type = typed_actor<Sigs...>;
default_uniform_type_info(std::string tname) : super(std::move(tname)) {
sub_uti = uniform_typeid<actor>();
......
......@@ -29,9 +29,9 @@ namespace detail {
template <class Base>
class embedded final : public Base {
public:
template <class... Vs>
embedded(intrusive_ptr<ref_counted> storage, Vs&&... vs)
: Base(std::forward<Vs>(vs)...),
template <class... Ts>
embedded(intrusive_ptr<ref_counted> storage, Ts&&... xs)
: Base(std::forward<Ts>(xs)...),
m_storage(std::move(storage)) {
// nop
}
......
......@@ -200,8 +200,8 @@ class intrusive_partitioned_list {
insert(second_end(), val);
}
template <class Actor, class... Vs>
bool invoke(Actor* self, iterator first, iterator last, Vs&... vs) {
template <class Actor, class... Ts>
bool invoke(Actor* self, iterator first, iterator last, Ts&... xs) {
pointer prev = first->prev;
pointer next = first->next;
auto move_on = [&](bool first_valid) {
......@@ -214,12 +214,12 @@ class intrusive_partitioned_list {
while (first != last) {
std::unique_ptr<value_type, deleter_type> tmp{first.ptr};
// since this function can be called recursively during
// self->invoke_message(tmp, vs...), we have to remove the
// self->invoke_message(tmp, xs...), we have to remove the
// element from the list proactively and put it back in if
// it's safe, i.e., if invoke_message returned im_skipped
prev->next = next;
next->prev = prev;
switch (self->invoke_message(tmp, vs...)) {
switch (self->invoke_message(tmp, xs...)) {
case policy::im_dropped:
move_on(false);
break;
......
......@@ -64,10 +64,10 @@ class basic_memory_cache;
template <class T>
struct rc_storage : public ref_counted {
T instance;
template <class... Vs>
rc_storage(Vs&&... vs)
template <class... Ts>
rc_storage(Ts&&... xs)
: instance(intrusive_ptr<ref_counted>(this, false),
std::forward<Vs>(vs)...) {
std::forward<Ts>(xs)...) {
CAF_REQUIRE(get_reference_count() >= 1);
}
};
......@@ -190,8 +190,8 @@ class memory {
public:
// Allocates storage, initializes a new object, and returns the new instance.
template <class T, class... Vs>
static T* create(Vs&&... vs) {
template <class T, class... Ts>
static T* create(Ts&&... xs) {
using embedded_t =
typename std::conditional<
T::memory_cache_flag == needs_embedding,
......@@ -201,7 +201,7 @@ class memory {
auto mc = get_or_set_cache_map_entry<T>();
auto es = mc->new_embedded_storage();
auto ptr = reinterpret_cast<embedded_t*>(es.second);
new (ptr) embedded_t(std::move(es.first), std::forward<Vs>(vs)...);
new (ptr) embedded_t(std::move(es.first), std::forward<Ts>(xs)...);
return ptr;
}
......
......@@ -105,8 +105,8 @@ class optional_message_visitor : public static_visitor<optional<message>> {
optional_message_visitor_enable_tpl<T>::value,
opt_msg
>::type
operator()(T& v, Ts&... vs) const {
return make_message(std::move(v), std::move(vs)...);
operator()(T& x, Ts&... xs) const {
return make_message(std::move(x), std::move(xs)...);
}
template <class T>
......
......@@ -57,27 +57,27 @@ class pair_storage {
union { embedded<FirstType> first; };
union { embedded<SecondType> second; };
template <class... Vs>
template <class... Ts>
pair_storage(intrusive_ptr<ref_counted> storage,
std::integral_constant<size_t, 0>, Vs&&... vs)
std::integral_constant<size_t, 0>, Ts&&... xs)
: first(storage),
second(std::move(storage), std::forward<Vs>(vs)...) {
second(std::move(storage), std::forward<Ts>(xs)...) {
// nop
}
template <class V0, class... Vs>
template <class T, class... Ts>
pair_storage(intrusive_ptr<ref_counted> storage,
std::integral_constant<size_t, 1>, V0&& v0, Vs&&... vs)
: first(storage, std::forward<V0>(v0)),
second(std::move(storage), std::forward<Vs>(vs)...) {
std::integral_constant<size_t, 1>, T&& x, Ts&&... xs)
: first(storage, std::forward<T>(x)),
second(std::move(storage), std::forward<Ts>(xs)...) {
// nop
}
template <class V0, class V1, class... Vs>
template <class T0, class T1, class... Ts>
pair_storage(intrusive_ptr<ref_counted> storage,
std::integral_constant<size_t, 2>, V0&& v0, V1&& v1, Vs&&... vs)
: first(storage, std::forward<V0>(v0), std::forward<V1>(v1)),
second(std::move(storage), std::forward<Vs>(vs)...) {
std::integral_constant<size_t, 2>, T0&& x0, T1&& x1, Ts&&... xs)
: first(storage, std::forward<T0>(x0), std::forward<T1>(x1)),
second(std::move(storage), std::forward<Ts>(xs)...) {
// nop
}
......
......@@ -41,17 +41,12 @@ struct conjunction;
template <>
struct conjunction<> {
static constexpr bool value = false;
};
template <bool V0>
struct conjunction<V0> {
static constexpr bool value = V0;
static constexpr bool value = true;
};
template <bool V0, bool V1, bool... Vs>
struct conjunction<V0, V1, Vs...> {
static constexpr bool value = V0 && conjunction<V1, Vs...>::value;
template <bool X, bool... Xs>
struct conjunction<X, Xs...> {
static constexpr bool value = X && conjunction<Xs...>::value;
};
/**
......@@ -60,16 +55,16 @@ struct conjunction<V0, V1, Vs...> {
template <bool... BoolConstants>
struct disjunction;
template <bool V0, bool... Vs>
struct disjunction<V0, Vs...> {
static constexpr bool value = V0 || disjunction<Vs...>::value;
};
template <>
struct disjunction<> {
static constexpr bool value = false;
};
template <bool X, bool... Xs>
struct disjunction<X, Xs...> {
static constexpr bool value = X || disjunction<Xs...>::value;
};
/**
* Equal to std::is_same<T, anything>.
*/
......
......@@ -70,7 +70,7 @@ class event_based_actor::functor_based : public extend<event_based_actor>::
with<mixin::functor_based> {
public:
template <class... Ts>
functor_based(Ts&&... vs) : combined_type(std::forward<Ts>(vs)...) {
functor_based(Ts&&... xs) : combined_type(std::forward<Ts>(xs)...) {
// nop
}
behavior make_behavior() override;
......
......@@ -70,35 +70,35 @@ class local_actor : public abstract_actor {
* spawn untyped actors *
****************************************************************************/
template <class T, spawn_options Os = no_spawn_options, class... Vs>
actor spawn(Vs&&... vs) {
template <class T, spawn_options Os = no_spawn_options, class... Ts>
actor spawn(Ts&&... xs) {
constexpr auto os = make_unbound(Os);
auto res = spawn_class<T, os>(host(), empty_before_launch_callback{},
std::forward<Vs>(vs)...);
std::forward<Ts>(xs)...);
return eval_opts(Os, std::move(res));
}
template <spawn_options Os = no_spawn_options, class... Vs>
actor spawn(Vs&&... vs) {
template <spawn_options Os = no_spawn_options, class... Ts>
actor spawn(Ts&&... xs) {
constexpr auto os = make_unbound(Os);
auto res = spawn_functor<os>(host(), empty_before_launch_callback{},
std::forward<Vs>(vs)...);
std::forward<Ts>(xs)...);
return eval_opts(Os, std::move(res));
}
template <class T, spawn_options Os, class... Vs>
actor spawn_in_group(const group& grp, Vs&&... vs) {
template <class T, spawn_options Os, class... Ts>
actor spawn_in_group(const group& grp, Ts&&... xs) {
constexpr auto os = make_unbound(Os);
auto res = spawn_class<T, os>(host(), group_subscriber{grp},
std::forward<Vs>(vs)...);
std::forward<Ts>(xs)...);
return eval_opts(Os, std::move(res));
}
template <spawn_options Os = no_spawn_options, class... Vs>
actor spawn_in_group(const group& grp, Vs&&... vs) {
template <spawn_options Os = no_spawn_options, class... Ts>
actor spawn_in_group(const group& grp, Ts&&... xs) {
constexpr auto os = make_unbound(Os);
auto res = spawn_functor<os>(host(), group_subscriber{grp},
std::forward<Vs>(vs)...);
std::forward<Ts>(xs)...);
return eval_opts(Os, std::move(res));
}
......@@ -106,30 +106,30 @@ class local_actor : public abstract_actor {
* spawn typed actors *
****************************************************************************/
template <class T, spawn_options Os = no_spawn_options, class... Vs>
template <class T, spawn_options Os = no_spawn_options, class... Ts>
typename actor_handle_from_signature_list<
typename T::signatures
>::type
spawn_typed(Vs&&... vs) {
spawn_typed(Ts&&... xs) {
constexpr auto os = make_unbound(Os);
auto res = spawn_class<T, os>(host(), empty_before_launch_callback{},
std::forward<Vs>(vs)...);
std::forward<Ts>(xs)...);
return eval_opts(Os, std::move(res));
}
template <spawn_options Os = no_spawn_options, typename F, class... Vs>
template <spawn_options Os = no_spawn_options, typename F, class... Ts>
typename infer_typed_actor_handle<
typename detail::get_callable_trait<F>::result_type,
typename detail::tl_head<
typename detail::get_callable_trait<F>::arg_types
>::type
>::type
spawn_typed(F fun, Vs&&... vs) {
spawn_typed(F fun, Ts&&... xs) {
constexpr auto os = make_unbound(Os);
auto res = caf::spawn_typed_functor<os>(host(),
empty_before_launch_callback{},
std::move(fun),
std::forward<Vs>(vs)...);
std::forward<Ts>(xs)...);
return eval_opts(Os, std::move(res));
}
......@@ -138,43 +138,43 @@ class local_actor : public abstract_actor {
****************************************************************************/
/**
* Sends `{vs...} to `dest` using the priority `mp`.
* Sends `{xs...} to `dest` using the priority `mp`.
*/
template <class... Vs>
void send(message_priority mp, const channel& dest, Vs&&... vs) {
static_assert(sizeof...(Vs) > 0, "sizeof...(Vs) == 0");
send_impl(mp, actor_cast<abstract_channel*>(dest), std::forward<Vs>(vs)...);
template <class... Ts>
void send(message_priority mp, const channel& dest, Ts&&... xs) {
static_assert(sizeof...(Ts) > 0, "sizeof...(Ts) == 0");
send_impl(mp, actor_cast<abstract_channel*>(dest), std::forward<Ts>(xs)...);
}
/**
* Sends `{vs...} to `dest` using normal priority.
* Sends `{xs...} to `dest` using normal priority.
*/
template <class... Vs>
void send(const channel& dest, Vs&&... vs) {
send(message_priority::normal, dest, std::forward<Vs>(vs)...);
template <class... Ts>
void send(const channel& dest, Ts&&... xs) {
send(message_priority::normal, dest, std::forward<Ts>(xs)...);
}
/**
* Sends `{vs...} to `dest` using the priority `mp`.
* Sends `{xs...} to `dest` using the priority `mp`.
*/
template <class... Ts, class... Vs>
void send(message_priority mp, const typed_actor<Ts...>& dest, Vs&&... vs) {
template <class... Sigs, class... Ts>
void send(message_priority mp, const typed_actor<Sigs...>& dest, Ts&&... xs) {
using token =
detail::type_list<
typename detail::implicit_conversions<
typename std::decay<Vs>::type
typename std::decay<Ts>::type
>::type...>;
token tk;
check_typed_input(dest, tk);
send_impl(mp, actor_cast<abstract_channel*>(dest), std::forward<Vs>(vs)...);
send_impl(mp, actor_cast<abstract_channel*>(dest), std::forward<Ts>(xs)...);
}
/**
* Sends `{vs...} to `dest` using normal priority.
* Sends `{xs...} to `dest` using normal priority.
*/
template <class... Ts, class... Vs>
void send(const typed_actor<Ts...>& dest, Vs&&... vs) {
send(message_priority::normal, dest, std::forward<Vs>(vs)...);
template <class... Sigs, class... Ts>
void send(const typed_actor<Sigs...>& dest, Ts&&... xs) {
send(message_priority::normal, dest, std::forward<Ts>(xs)...);
}
/**
......@@ -194,19 +194,19 @@ class local_actor : public abstract_actor {
* Sends a message to `dest` that is delayed by `rel_time`
* using the priority `mp`.
*/
template <class... Vs>
template <class... Ts>
void delayed_send(message_priority mp, const channel& dest,
const duration& rtime, Vs&&... vs) {
delayed_send_impl(mp, dest, rtime, make_message(std::forward<Vs>(vs)...));
const duration& rtime, Ts&&... xs) {
delayed_send_impl(mp, dest, rtime, make_message(std::forward<Ts>(xs)...));
}
/**
* Sends a message to `dest` that is delayed by `rel_time`.
*/
template <class... Vs>
void delayed_send(const channel& dest, const duration& rtime, Vs&&... vs) {
template <class... Ts>
void delayed_send(const channel& dest, const duration& rtime, Ts&&... xs) {
delayed_send_impl(message_priority::normal, dest, rtime,
make_message(std::forward<Vs>(vs)...));
make_message(std::forward<Ts>(xs)...));
}
/****************************************************************************
......@@ -501,17 +501,17 @@ class local_actor : public abstract_actor {
/** @endcond */
private:
template <class V, class... Vs>
template <class T, class... Ts>
typename std::enable_if<
!std::is_same<typename std::decay<V>::type, message>::value
!std::is_same<typename std::decay<T>::type, message>::value
>::type
send_impl(message_priority mp, abstract_channel* dest, V&& v, Vs&&... vs) {
send_impl(message_priority mp, abstract_channel* dest, T&& x, Ts&&... xs) {
if (!dest) {
return;
}
dest->enqueue(mailbox_element::make_joint(address(), message_id::make(mp),
std::forward<V>(v),
std::forward<Vs>(vs)...),
std::forward<T>(x),
std::forward<Ts>(xs)...),
host());
}
......
......@@ -64,18 +64,18 @@ class mailbox_element : public memory_managed {
static unique_ptr make(actor_addr sender, message_id id, message msg);
template <class... Vs>
static unique_ptr make_joint(actor_addr sender, message_id id, Vs&&... vs) {
template <class... Ts>
static unique_ptr make_joint(actor_addr sender, message_id id, Ts&&... xs) {
using value_storage =
detail::tuple_vals<
typename unbox_message_element<
typename detail::strip_and_convert<Vs>::type
typename detail::strip_and_convert<Ts>::type
>::type...
>;
std::integral_constant<size_t, 2> tk;
using storage = detail::pair_storage<mailbox_element, value_storage>;
auto ptr = detail::memory::create<storage>(tk, std::move(sender), id,
std::forward<Vs>(vs)...);
std::forward<Ts>(xs)...);
ptr->first.msg.reset(&(ptr->second), false);
return unique_ptr{&(ptr->first)};
}
......
......@@ -95,14 +95,14 @@ struct has_none {
return false;
}
template <class V, class... Vs>
bool operator()(const V&, const Vs&... vs) const {
return (*this)(vs...);
template <class T, class... Ts>
bool operator()(const T&, const Ts&... xs) const {
return (*this)(xs...);
}
template <class V, class... Vs>
bool operator()(const optional<V>& v, const Vs&... vs) const {
return !v || (*this)(vs...);
template <class T, class... Ts>
bool operator()(const optional<T>& x, const Ts&... xs) const {
return !x || (*this)(xs...);
}
};
......@@ -113,9 +113,9 @@ class lfinvoker {
// nop
}
template <class... Vs>
typename detail::get_callable_trait<F>::result_type operator()(Vs&&... vs) {
return m_fun(unopt(std::forward<Vs>(vs))...);
template <class... Ts>
typename detail::get_callable_trait<F>::result_type operator()(Ts&&... xs) {
return m_fun(unopt(std::forward<Ts>(xs))...);
}
private:
......@@ -129,9 +129,9 @@ class lfinvoker<true, F> {
// nop
}
template <class... Vs>
unit_t operator()(Vs&&... vs) {
m_fun(unopt(std::forward<Vs>(vs))...);
template <class... Ts>
unit_t operator()(Ts&&... xs) {
m_fun(unopt(std::forward<Ts>(xs))...);
return unit;
}
......
......@@ -343,8 +343,8 @@ class message {
struct move_from_tuple_helper {
template <class... Ts>
inline message operator()(Ts&... vs) {
return make_message(std::move(vs)...);
inline message operator()(Ts&... xs) {
return make_message(std::move(xs)...);
}
};
......@@ -442,24 +442,24 @@ struct unbox_message_element<atom_constant<V>> {
};
/**
* Returns a new `message` containing the values `(v, vs...)`.
* Returns a new `message` containing the values `(x, xs...)`.
* @relates message
*/
template <class V, class... Vs>
template <class V, class... Ts>
typename std::enable_if<
!std::is_same<message, typename std::decay<V>::type>::value
|| (sizeof...(Vs) > 0),
|| (sizeof...(Ts) > 0),
message
>::type
make_message(V&& v, Vs&&... vs) {
make_message(V&& x, Ts&&... xs) {
using storage
= detail::tuple_vals<typename unbox_message_element<
typename detail::strip_and_convert<V>::type
>::type,
typename unbox_message_element<
typename detail::strip_and_convert<Vs>::type
typename detail::strip_and_convert<Ts>::type
>::type...>;
auto ptr = make_counted<storage>(std::forward<V>(v), std::forward<Vs>(vs)...);
auto ptr = make_counted<storage>(std::forward<V>(x), std::forward<Ts>(xs)...);
return message{detail::message_data::cow_ptr{std::move(ptr)}};
}
......
......@@ -71,11 +71,11 @@ class message_builder {
}
/**
* Adds `what` to the elements of the buffer.
* Adds `x` to the elements of the buffer.
*/
template <class T>
message_builder& append(T what) {
return append_impl<T>(std::move(what));
message_builder& append(T x) {
return append_impl<T>(std::move(x));
}
/**
......
......@@ -84,17 +84,17 @@ class message_handler {
* functors, or other message handlers.
*/
template <class T, class... Ts>
message_handler(const T& v, Ts&&... vs) {
assign(v, std::forward<Ts>(vs)...);
message_handler(const T& v, Ts&&... xs) {
assign(v, std::forward<Ts>(xs)...);
}
/**
* Assigns new message handlers.
*/
template <class... Vs>
void assign(Vs... vs) {
static_assert(sizeof...(Vs) > 0, "assign without arguments called");
m_impl = detail::make_behavior(vs...);
template <class... Ts>
void assign(Ts... xs) {
static_assert(sizeof...(Ts) > 0, "assign without arguments called");
m_impl = detail::make_behavior(xs...);
}
/**
......
......@@ -41,8 +41,8 @@ class behavior_stack_based_impl : public Base {
nonblocking_response_handle_tag>;
template <class... Ts>
behavior_stack_based_impl(Ts&&... vs)
: Base(std::forward<Ts>(vs)...),
behavior_stack_based_impl(Ts&&... xs)
: Base(std::forward<Ts>(xs)...),
m_timeout_id(0) {
// nop
}
......
......@@ -39,12 +39,12 @@ class functor_based : public Base {
}
template <class F, class... Ts>
functor_based(F f, Ts&&... vs) {
init(std::move(f), std::forward<Ts>(vs)...);
functor_based(F f, Ts&&... xs) {
init(std::move(f), std::forward<Ts>(xs)...);
}
template <class F, class... Ts>
void init(F f, Ts&&... vs) {
void init(F f, Ts&&... xs) {
using trait = typename detail::get_callable_trait<F>::type;
using arg_types = typename trait::arg_types;
using result_type = typename trait::result_type;
......@@ -54,7 +54,7 @@ class functor_based : public Base {
typename detail::tl_head<arg_types>::type, pointer>::value;
std::integral_constant<bool, returns_behavior> token1;
std::integral_constant<bool, uses_first_arg> token2;
set(token1, token2, std::move(f), std::forward<Ts>(vs)...);
set(token1, token2, std::move(f), std::forward<Ts>(xs)...);
}
protected:
......
This diff is collapsed.
......@@ -51,8 +51,8 @@ class not_prioritizing {
self->mailbox().cache().push_second_back(ptr.release());
}
template <class Actor, class... Vs>
bool invoke_from_cache(Actor* self, Vs&... args) {
template <class Actor, class... Ts>
bool invoke_from_cache(Actor* self, Ts&... args) {
auto& cache = self->mailbox().cache();
auto i = cache.second_begin();
auto e = cache.second_end();
......
......@@ -68,9 +68,9 @@ class response_handle<Self, message, nonblocking_response_handle_tag> {
// nop
}
template <class... Vs>
continue_helper then(Vs&&... vs) const {
behavior bhvr{std::forward<Vs>(vs)...};
template <class... Ts>
continue_helper then(Ts&&... xs) const {
behavior bhvr{std::forward<Ts>(xs)...};
m_self->bhvr_stack().push_back(std::move(bhvr), m_mid);
return {m_mid};
}
......@@ -138,9 +138,9 @@ class response_handle<Self, message, blocking_response_handle_tag> {
m_self->dequeue_response(bhvr, m_mid);
}
template <class... Vs>
void await(Vs&&... vs) const {
behavior bhvr{std::forward<Vs>(vs)...};
template <class... Ts>
void await(Ts&&... xs) const {
behavior bhvr{std::forward<Ts>(xs)...};
m_self->dequeue_response(bhvr, m_mid);
}
......
......@@ -36,104 +36,104 @@ namespace caf {
/**
* Sends `to` a message under the identity of `from` with priority `prio`.
*/
template <class... Vs>
template <class... Ts>
void send_as(const actor& from, message_priority prio,
const channel& to, Vs&&... vs) {
const channel& to, Ts&&... xs) {
if (!to) {
return;
}
message_id mid;
to->enqueue(from.address(),
prio == message_priority::high ? mid.with_high_priority() : mid,
make_message(std::forward<Vs>(vs)...), nullptr);
make_message(std::forward<Ts>(xs)...), nullptr);
}
/**
* Sends `to` a message under the identity of `from`.
*/
template <class... Vs>
void send_as(const actor& from, const channel& to, Vs&&... vs) {
send_as(from, message_priority::normal, to, std::forward<Vs>(vs)...);
template <class... Ts>
void send_as(const actor& from, const channel& to, Ts&&... xs) {
send_as(from, message_priority::normal, to, std::forward<Ts>(xs)...);
}
/**
* Sends `to` a message under the identity of `from` with priority `prio`.
*/
template <class... Rs, class... Vs>
template <class... Sigs, class... Ts>
void send_as(const actor& from, message_priority prio,
const typed_actor<Rs...>& to, Vs&&... vs) {
const typed_actor<Sigs...>& to, Ts&&... xs) {
using token =
detail::type_list<
typename detail::implicit_conversions<
typename std::decay<Vs>::type
typename std::decay<Ts>::type
>::type...>;
token tk;
check_typed_input(to, tk);
send_as(from, prio, actor_cast<channel>(to), std::forward<Vs>(vs)...);
send_as(from, prio, actor_cast<channel>(to), std::forward<Ts>(xs)...);
}
/**
* Sends `to` a message under the identity of `from`.
*/
template <class... Rs, class... Vs>
void send_as(const actor& from, const typed_actor<Rs...>& to, Vs&&... vs) {
template <class... Sigs, class... Ts>
void send_as(const actor& from, const typed_actor<Sigs...>& to, Ts&&... xs) {
using token =
detail::type_list<
typename detail::implicit_conversions<
typename std::decay<Vs>::type
typename std::decay<Ts>::type
>::type...>;
token tk;
check_typed_input(to, tk);
send_as(from, message_priority::normal,
actor_cast<channel>(to), std::forward<Vs>(vs)...);
actor_cast<channel>(to), std::forward<Ts>(xs)...);
}
/**
* Anonymously sends `to` a message with priority `prio`.
*/
template <class... Vs>
void anon_send(message_priority prio, const channel& to, Vs&&... vs) {
send_as(invalid_actor, prio, to, std::forward<Vs>(vs)...);
template <class... Ts>
void anon_send(message_priority prio, const channel& to, Ts&&... xs) {
send_as(invalid_actor, prio, to, std::forward<Ts>(xs)...);
}
/**
* Anonymously sends `to` a message.
*/
template <class... Vs>
void anon_send(const channel& to, Vs&&... vs) {
send_as(invalid_actor, message_priority::normal, to, std::forward<Vs>(vs)...);
template <class... Ts>
void anon_send(const channel& to, Ts&&... xs) {
send_as(invalid_actor, message_priority::normal, to, std::forward<Ts>(xs)...);
}
/**
* Anonymously sends `to` a message with priority `prio`.
*/
template <class... Rs, class... Vs>
void anon_send(message_priority prio, const typed_actor<Rs...>& to,
Vs&&... vs) {
template <class... Sigs, class... Ts>
void anon_send(message_priority prio, const typed_actor<Sigs...>& to,
Ts&&... xs) {
using token =
detail::type_list<
typename detail::implicit_conversions<
typename std::decay<Vs>::type
typename std::decay<Ts>::type
>::type...>;
token tk;
check_typed_input(to, tk);
anon_send(prio, actor_cast<channel>(to), std::forward<Vs>(vs)...);
anon_send(prio, actor_cast<channel>(to), std::forward<Ts>(xs)...);
}
/**
* Anonymously sends `to` a message.
*/
template <class... Rs, class... Vs>
void anon_send(const typed_actor<Rs...>& to, Vs&&... vs) {
template <class... Sigs, class... Ts>
void anon_send(const typed_actor<Sigs...>& to, Ts&&... xs) {
using token =
detail::type_list<
typename detail::implicit_conversions<
typename std::decay<Vs>::type
typename std::decay<Ts>::type
>::type...>;
token tk;
check_typed_input(to, tk);
anon_send(message_priority::normal, actor_cast<channel>(to),
std::forward<Vs>(vs)...);
std::forward<Ts>(xs)...);
}
/**
......
......@@ -234,13 +234,13 @@ actor spawn_in_group(const group& grp, Ts&&... args) {
/**
* Base class for strongly typed actors using a functor-based implementation.
*/
template <class... Rs>
class functor_based_typed_actor : public typed_event_based_actor<Rs...> {
template <class... Sigs>
class functor_based_typed_actor : public typed_event_based_actor<Sigs...> {
public:
/**
* Base class for actors using given interface.
*/
using base = typed_event_based_actor<Rs...>;
using base = typed_event_based_actor<Sigs...>;
/**
* Pointer to the base class.
......@@ -339,14 +339,14 @@ class functor_based_typed_actor : public typed_event_based_actor<Rs...> {
template <class Result, class FirstArg>
struct infer_typed_actor_base;
template <class... Rs, class FirstArg>
struct infer_typed_actor_base<typed_behavior<Rs...>, FirstArg> {
using type = functor_based_typed_actor<Rs...>;
template <class... Sigs, class FirstArg>
struct infer_typed_actor_base<typed_behavior<Sigs...>, FirstArg> {
using type = functor_based_typed_actor<Sigs...>;
};
template <class... Rs>
struct infer_typed_actor_base<void, typed_event_based_actor<Rs...>*> {
using type = functor_based_typed_actor<Rs...>;
template <class... Sigs>
struct infer_typed_actor_base<void, typed_event_based_actor<Sigs...>*> {
using type = functor_based_typed_actor<Sigs...>;
};
/**
......
......@@ -76,23 +76,23 @@ template <class TypedBehavior, class FirstArg>
struct infer_typed_actor_handle;
// infer actor type from result type if possible
template <class... Rs, class FirstArg>
struct infer_typed_actor_handle<typed_behavior<Rs...>, FirstArg> {
using type = typed_actor<Rs...>;
template <class... Sigs, class FirstArg>
struct infer_typed_actor_handle<typed_behavior<Sigs...>, FirstArg> {
using type = typed_actor<Sigs...>;
};
// infer actor type from first argument if result type is void
template <class... Rs>
struct infer_typed_actor_handle<void, typed_event_based_actor<Rs...>*> {
using type = typed_actor<Rs...>;
template <class... Sigs>
struct infer_typed_actor_handle<void, typed_event_based_actor<Sigs...>*> {
using type = typed_actor<Sigs...>;
};
template <class SignatureList>
struct actor_handle_from_signature_list;
template <class... Rs>
struct actor_handle_from_signature_list<detail::type_list<Rs...>> {
using type = typed_actor<Rs...>;
template <class... Sigs>
struct actor_handle_from_signature_list<detail::type_list<Sigs...>> {
using type = typed_actor<Sigs...>;
};
template <spawn_options Os, typename BeforeLaunch, typename F, class... Ts>
......
......@@ -36,18 +36,19 @@ class local_actor;
struct invalid_actor_addr_t;
template <class... Rs>
template <class... Sigs>
class typed_event_based_actor;
/**
* Identifies a strongly typed actor.
* @tparam Rs Interface as `replies_to<...>::with<...>` parameter pack.
* @tparam Sigs Signature of this actor as `replies_to<...>::with<...>`
* parameter pack.
*/
template <class... Rs>
template <class... Sigs>
class typed_actor
: detail::comparable<typed_actor<Rs...>>,
detail::comparable<typed_actor<Rs...>, actor_addr>,
detail::comparable<typed_actor<Rs...>, invalid_actor_addr_t> {
: detail::comparable<typed_actor<Sigs...>>,
detail::comparable<typed_actor<Sigs...>, actor_addr>,
detail::comparable<typed_actor<Sigs...>, invalid_actor_addr_t> {
friend class local_actor;
......@@ -63,24 +64,24 @@ class typed_actor
template <class... Es>
struct extend {
using type = typed_actor<Rs..., Es...>;
using type = typed_actor<Sigs..., Es...>;
};
/**
* Identifies the behavior type actors of this kind use
* for their behavior stack.
*/
using behavior_type = typed_behavior<Rs...>;
using behavior_type = typed_behavior<Sigs...>;
/**
* Identifies pointers to instances of this kind of actor.
*/
using pointer = typed_event_based_actor<Rs...>*;
using pointer = typed_event_based_actor<Sigs...>*;
/**
* Identifies the base class for this kind of actor.
*/
using base = typed_event_based_actor<Rs...>;
using base = typed_event_based_actor<Sigs...>;
typed_actor() = default;
typed_actor(typed_actor&&) = default;
......@@ -88,13 +89,13 @@ class typed_actor
typed_actor& operator=(typed_actor&&) = default;
typed_actor& operator=(const typed_actor&) = default;
template <class... OtherRs>
typed_actor(const typed_actor<OtherRs...>& other) {
template <class... OtherSigs>
typed_actor(const typed_actor<OtherSigs...>& other) {
set(std::move(other));
}
template <class... OtherRs>
typed_actor& operator=(const typed_actor<OtherRs...>& other) {
template <class... OtherSigs>
typed_actor& operator=(const typed_actor<OtherSigs...>& other) {
set(std::move(other));
return *this;
}
......@@ -132,7 +133,7 @@ class typed_actor
}
static std::set<std::string> message_types() {
return {Rs::static_type_name()...};
return {Sigs::static_type_name()...};
}
explicit operator bool() const { return static_cast<bool>(m_ptr); }
......@@ -151,15 +152,15 @@ class typed_actor
"'this' must be a strict subset of 'other'");
}
template <class... OtherRs>
inline void set(const typed_actor<OtherRs...>& other) {
check_signatures<detail::type_list<Rs...>, detail::type_list<OtherRs...>>();
template <class... OtherSigs>
inline void set(const typed_actor<OtherSigs...>& other) {
check_signatures<detail::type_list<Sigs...>, detail::type_list<OtherSigs...>>();
m_ptr = other.m_ptr;
}
template <class Impl>
inline void set(intrusive_ptr<Impl>& other) {
check_signatures<detail::type_list<Rs...>, typename Impl::signatures>();
check_signatures<detail::type_list<Sigs...>, typename Impl::signatures>();
m_ptr = std::move(other);
}
......
......@@ -30,7 +30,7 @@
namespace caf {
template <class... Rs>
template <class... Sigs>
class functor_based_typed_actor;
namespace detail {
......@@ -57,18 +57,6 @@ struct collapse_replies_to_statement<List, none_t> {
using type = List;
};
/*
template <class List>
struct unbox_typed_continue_helper {
using type = List;
};
template <class List>
struct unbox_typed_continue_helper<typed_continue_helper<List>> {
using type = List;
};
*/
template <class Input, class RepliesToWith>
struct same_input : std::is_same<Input, typename RepliesToWith::input_types> {};
......@@ -168,7 +156,7 @@ void static_check_typed_behavior_input() {
} // namespace detail
template <class... Rs>
template <class... Sigs>
class typed_actor;
namespace mixin {
......@@ -176,10 +164,10 @@ template <class, class, class>
class behavior_stack_based_impl;
}
template <class... Rs>
template <class... Sigs>
class typed_behavior {
public:
template <class... OtherRs>
template <class... OtherSigs>
friend class typed_actor;
template <class, class, class>
......@@ -193,11 +181,11 @@ class typed_behavior {
typed_behavior& operator=(typed_behavior&&) = default;
typed_behavior& operator=(const typed_behavior&) = default;
using signatures = detail::type_list<Rs...>;
using signatures = detail::type_list<Sigs...>;
template <class... Vs>
typed_behavior(Vs... vs) {
set(detail::make_behavior(vs...));
template <class... Ts>
typed_behavior(Ts... xs) {
set(detail::make_behavior(xs...));
}
explicit operator bool() const {
......
......@@ -37,18 +37,18 @@ namespace caf {
* `blocking_api` flag.
* @extends mailbox_based_actor
*/
template <class... Rs>
template <class... Sigs>
class typed_event_based_actor : public
extend<mailbox_based_actor, typed_event_based_actor<Rs...>>::template
with<mixin::behavior_stack_based<typed_behavior<Rs...>>::template impl,
extend<mailbox_based_actor, typed_event_based_actor<Sigs...>>::template
with<mixin::behavior_stack_based<typed_behavior<Sigs...>>::template impl,
mixin::sync_sender<nonblocking_response_handle_tag>::template impl> {
public:
using signatures = detail::type_list<Rs...>;
using signatures = detail::type_list<Sigs...>;
using behavior_type = typed_behavior<Rs...>;
using behavior_type = typed_behavior<Sigs...>;
std::set<std::string> message_types() const override {
return {Rs::static_type_name()...};
return {Sigs::static_type_name()...};
}
protected:
......
......@@ -68,10 +68,10 @@ inline void deliver(delayed_msg& dm) {
}
template <class Map, class... Ts>
inline void insert_dmsg(Map& storage, const duration& d, Ts&&... vs) {
inline void insert_dmsg(Map& storage, const duration& d, Ts&&... xs) {
auto tout = hrc::now();
tout += d;
delayed_msg dmsg{std::forward<Ts>(vs)...};
delayed_msg dmsg{std::forward<Ts>(xs)...};
storage.insert(std::make_pair(std::move(tout), std::move(dmsg)));
}
......
......@@ -226,9 +226,9 @@ class broker : public extend<local_actor>::
/** @cond PRIVATE */
template <class F, class... Ts>
actor fork(F fun, connection_handle hdl, Ts&&... vs) {
actor fork(F fun, connection_handle hdl, Ts&&... xs) {
// provoke compile-time errors early
using fun_res = decltype(fun(this, hdl, std::forward<Ts>(vs)...));
using fun_res = decltype(fun(this, hdl, std::forward<Ts>(xs)...));
// prevent warning about unused local type
static_assert(std::is_same<fun_res, fun_res>::value,
"your compiler is lying to you");
......@@ -245,7 +245,7 @@ class broker : public extend<local_actor>::
forked->m_scribes.insert(
std::make_pair(sptr->hdl(), sptr));
},
fun, hdl, std::forward<Ts>(vs)...);
fun, hdl, std::forward<Ts>(xs)...);
}
inline void add_scribe(const scribe_pointer& ptr) {
......@@ -393,7 +393,7 @@ class broker::functor_based : public extend<broker>::
using super = combined_type;
template <class... Ts>
functor_based(Ts&&... vs) : super(std::forward<Ts>(vs)...) {
functor_based(Ts&&... xs) : super(std::forward<Ts>(xs)...) {
// nop
}
......
......@@ -59,7 +59,7 @@
# include <sys/socket.h>
#endif
// poll vs epoll backend
// poll xs epoll backend
#if !defined(CAF_LINUX) || defined(CAF_POLL_IMPL) // poll() multiplexer
# define CAF_POLL_MULTIPLEXER
# ifndef CAF_WINDOWS
......@@ -105,7 +105,7 @@ namespace network {
constexpr int ec_interrupted_syscall = EINTR;
#endif
// poll vs epoll backend
// poll xs epoll backend
#if !defined(CAF_LINUX) || defined(CAF_POLL_IMPL) // poll() multiplexer
# ifdef CAF_WINDOWS
// From the MSDN: If the POLLPRI flag is set on a socket for the Microsoft
......
......@@ -53,8 +53,8 @@ inline uint16_t publish(caf::actor whom, uint16_t port,
/**
* @copydoc publish(actor,uint16_t,const char*)
*/
template <class... Rs>
uint16_t typed_publish(typed_actor<Rs...> whom, uint16_t port,
template <class... Sigs>
uint16_t typed_publish(typed_actor<Sigs...> whom, uint16_t port,
const char* in = nullptr, bool reuse_addr = false) {
if (!whom) {
return 0;
......
......@@ -34,20 +34,6 @@ namespace io {
abstract_actor_ptr remote_actor_impl(std::set<std::string> ifs,
const std::string& host, uint16_t port);
template <class List>
struct typed_remote_actor_helper;
template <template <class...> class List, class... Ts>
struct typed_remote_actor_helper<List<Ts...>> {
using return_type = typed_actor<Ts...>;
template <class... Vs>
return_type operator()(Vs&&... vs) {
auto iface = return_type::message_types();
auto tmp = remote_actor_impl(std::move(iface), std::forward<Vs>(vs)...);
return actor_cast<return_type>(tmp);
}
};
/**
* Establish a new connection to the actor at `host` on given `port`.
* @param host Valid hostname or IP address.
......@@ -71,11 +57,11 @@ inline actor remote_actor(const std::string& host, uint16_t port) {
* @throws network_error Thrown on connection error or when connecting
* to an untyped otherwise unexpected actor.
*/
template <class List>
typename typed_remote_actor_helper<List>::return_type
typed_remote_actor(const std::string& host, uint16_t port) {
typed_remote_actor_helper<List> f;
return f(host, port);
template <class ActorHandle>
ActorHandle typed_remote_actor(const std::string& host, uint16_t port) {
auto iface = ActorHandle::message_types();
return actor_cast<ActorHandle>(remote_actor_impl(std::move(iface),
host, port));
}
} // namespace io
......
......@@ -38,8 +38,8 @@ namespace io {
*/
template <spawn_options Os = no_spawn_options,
typename F = std::function<void(broker*)>, class... Ts>
actor spawn_io(F fun, Ts&&... vs) {
return spawn<broker::functor_based>(std::move(fun), std::forward<Ts>(vs)...);
actor spawn_io(F fun, Ts&&... xs) {
return spawn<broker::functor_based>(std::move(fun), std::forward<Ts>(xs)...);
}
/**
......
......@@ -247,7 +247,7 @@ namespace network {
#endif
/******************************************************************************
* epoll() vs. poll() *
* epoll() xs. poll() *
******************************************************************************/
#ifdef CAF_EPOLL_MULTIPLEXER
......
......@@ -276,15 +276,15 @@ class middleman_actor_impl : public middleman_actor_base::base {
return result;
}
template <class T, class... Vs>
void handle_ok(map_type& storage, int64_t request_id, Vs&&... vs) {
template <class T, class... Ts>
void handle_ok(map_type& storage, int64_t request_id, Ts&&... xs) {
CAF_LOG_TRACE(CAF_ARG(request_id));
auto i = storage.find(request_id);
if (i == storage.end()) {
CAF_LOG_ERROR("request id not found: " << request_id);
return;
}
i->second.deliver(T{ok_atom::value, std::forward<Vs>(vs)...}.value);
i->second.deliver(T{ok_atom::value, std::forward<Ts>(xs)...}.value);
storage.erase(i);
}
......
......@@ -45,8 +45,8 @@ void fill_mb(message_builder&) {
}
template <class T, class... Ts>
void fill_mb(message_builder& mb, const T& v, const Ts&... vs) {
fill_mb(mb.append(v), vs...);
void fill_mb(message_builder& mb, const T& x, const Ts&... xs) {
fill_mb(mb.append(x), xs...);
}
template <class... Ts>
......
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