Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
05e6d767
Commit
05e6d767
authored
Sep 01, 2016
by
ufownl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix compile error
parent
fc60f8a7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
libcaf_core/caf/mixin/sender.hpp
libcaf_core/caf/mixin/sender.hpp
+1
-1
libcaf_core/test/typed_spawn.cpp
libcaf_core/test/typed_spawn.cpp
+22
-0
No files found.
libcaf_core/caf/mixin/sender.hpp
View file @
05e6d767
...
...
@@ -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
...
...
libcaf_core/test/typed_spawn.cpp
View file @
05e6d767
...
...
@@ -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.0
f
);
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.0
f
);
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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment