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
f9cad67e
Commit
f9cad67e
authored
May 06, 2013
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
accept lvalue for or_else, fixes #93
parent
dae0a89c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
3 deletions
+16
-3
cppa/detail/behavior_impl.hpp
cppa/detail/behavior_impl.hpp
+0
-1
cppa/partial_function.hpp
cppa/partial_function.hpp
+2
-2
unit_testing/test_match.cpp
unit_testing/test_match.cpp
+14
-0
No files found.
cppa/detail/behavior_impl.hpp
View file @
f9cad67e
...
@@ -133,7 +133,6 @@ class default_behavior_impl : public behavior_impl {
...
@@ -133,7 +133,6 @@ class default_behavior_impl : public behavior_impl {
return
new
default_behavior_impl
<
MatchExpr
,
std
::
function
<
void
()
>
>
(
m_expr
,
tdef
);
return
new
default_behavior_impl
<
MatchExpr
,
std
::
function
<
void
()
>
>
(
m_expr
,
tdef
);
}
}
void
handle_timeout
()
{
m_fun
();
}
void
handle_timeout
()
{
m_fun
();
}
private:
private:
...
...
cppa/partial_function.hpp
View file @
f9cad67e
...
@@ -107,7 +107,7 @@ class partial_function {
...
@@ -107,7 +107,7 @@ class partial_function {
*/
*/
template
<
typename
...
Ts
>
template
<
typename
...
Ts
>
typename
std
::
conditional
<
typename
std
::
conditional
<
util
::
disjunction
<
Ts
::
may_have_timeout
...
>::
value
,
util
::
disjunction
<
util
::
rm_ref
<
Ts
>::
type
::
may_have_timeout
...
>::
value
,
behavior
,
behavior
,
partial_function
partial_function
>::
type
>::
type
...
@@ -163,7 +163,7 @@ inline bool partial_function::operator()(T&& arg) {
...
@@ -163,7 +163,7 @@ inline bool partial_function::operator()(T&& arg) {
template
<
typename
...
Ts
>
template
<
typename
...
Ts
>
typename
std
::
conditional
<
typename
std
::
conditional
<
util
::
disjunction
<
Ts
::
may_have_timeout
...
>::
value
,
util
::
disjunction
<
util
::
rm_ref
<
Ts
>::
type
::
may_have_timeout
...
>::
value
,
behavior
,
behavior
,
partial_function
partial_function
>::
type
>::
type
...
...
unit_testing/test_match.cpp
View file @
f9cad67e
...
@@ -382,5 +382,19 @@ int main() {
...
@@ -382,5 +382,19 @@ int main() {
bhvr_check
(
bhvr1
,
make_any_tuple
(
2.
f
),
true
,
"<float>@2"
);
bhvr_check
(
bhvr1
,
make_any_tuple
(
2.
f
),
true
,
"<float>@2"
);
bhvr_check
(
bhvr1
,
make_any_tuple
(
""
),
true
,
"<*>@4"
);
bhvr_check
(
bhvr1
,
make_any_tuple
(
""
),
true
,
"<*>@4"
);
partial_function
pf11
{
on_arg_match
>>
[
&
](
int
)
{
last_invoked_fun
=
"<int>@1"
;
}
};
partial_function
pf12
{
on_arg_match
>>
[
&
](
int
)
{
last_invoked_fun
=
"<int>@2"
;
},
on_arg_match
>>
[
&
](
float
)
{
last_invoked_fun
=
"<float>@2"
;
}
};
auto
pf13
=
pf11
.
or_else
(
pf12
);
bhvr_check
(
pf13
,
make_any_tuple
(
42
),
true
,
"<int>@1"
);
bhvr_check
(
pf13
,
make_any_tuple
(
42.24
f
),
true
,
"<float>@2"
);
return
CPPA_TEST_RESULT
();
return
CPPA_TEST_RESULT
();
}
}
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