Commit 05e6d767 authored by ufownl's avatar ufownl

Fix compile error

parent fc60f8a7
......@@ -71,7 +71,7 @@ public:
"statically typed actors; use anon_send() or request() when "
"communicating with dynamically typed actors");
static_assert(res_t::valid, "receiver does not accept given message");
static_assert(std::is_same<typename res_t::type, type_list<>>::value
static_assert(is_void_response<typename res_t::type>::value
|| response_type_unbox<
signatures_of_t<Subtype>,
typename res_t::type
......
......@@ -260,6 +260,8 @@ maybe_string_delegator(maybe_string_actor::pointer self, maybe_string_actor x) {
using int_actor = typed_actor<replies_to<int>::with<int>>;
using float_actor = typed_actor<reacts_to<float>>;
int_actor::behavior_type int_fun() {
return {
[](int i) { return i * i; }
......@@ -297,6 +299,25 @@ behavior foo2(event_based_actor* self) {
};
}
float_actor::behavior_type float_fun(float_actor::pointer self) {
return {
[=](float a) {
CAF_CHECK_EQUAL(a, 1.0f);
self->quit(exit_reason::user_shutdown);
}
};
}
int_actor::behavior_type foo3(int_actor::pointer self) {
auto b = self->spawn<linked>(float_fun);
self->send(b, 1.0f);
return {
[=](int) {
return 0;
}
};
}
struct fixture {
actor_system_config cfg;
actor_system system;
......@@ -452,6 +473,7 @@ CAF_TEST(sending_typed_actors) {
CAF_CHECK_EQUAL(i, 100);
}
);
self->spawn(foo3);
}
CAF_TEST(sending_typed_actors_and_down_msg) {
......
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