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
01b91604
Commit
01b91604
authored
May 09, 2012
by
neverlord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow on_arg_match.when()
parent
1ca89acf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
38 deletions
+50
-38
cppa/on.hpp
cppa/on.hpp
+50
-38
No files found.
cppa/on.hpp
View file @
01b91604
...
...
@@ -247,42 +247,6 @@ struct pattern_type : pattern_type_<util::is_callable<T>::value && !detail::is_b
{
};
class
on_the_fly_rvalue_builder
{
public:
constexpr
on_the_fly_rvalue_builder
()
{
}
template
<
typename
Expr
>
match_expr
<
typename
get_case
<
false
,
Expr
,
value_guard
<
util
::
type_list
<>
>
,
util
::
type_list
<>
,
util
::
type_list
<>
>::
type
>
operator
>>
(
Expr
expr
)
const
{
typedef
typename
get_case
<
false
,
Expr
,
value_guard
<
util
::
type_list
<>
>
,
util
::
type_list
<>
,
util
::
type_list
<>
>::
type
result
;
return
result
{
typename
result
::
first_type
{},
typename
result
::
second_type
{
std
::
move
(
expr
),
value_guard
<
util
::
type_list
<>
>
{}}};
}
};
}
}
// cppa::detail
...
...
@@ -359,8 +323,6 @@ typedef typename detail::boxed<util::arg_match_t>::type boxed_arg_match_t;
constexpr
boxed_arg_match_t
arg_match
=
boxed_arg_match_t
();
constexpr
detail
::
on_the_fly_rvalue_builder
on_arg_match
;
template
<
typename
Arg0
,
typename
...
Args
>
detail
::
rvalue_builder
<
detail
::
value_guard
<
...
...
@@ -429,6 +391,56 @@ inline decltype(on<anything>()) others()
return
on
<
anything
>
();
}
// some more convenience
namespace
detail
{
class
on_the_fly_rvalue_builder
{
public:
constexpr
on_the_fly_rvalue_builder
()
{
}
template
<
typename
Guard
>
auto
when
(
Guard
g
)
const
->
decltype
(
on
(
arg_match
).
when
(
g
))
{
return
on
(
arg_match
).
when
(
g
);
}
template
<
typename
Expr
>
match_expr
<
typename
get_case
<
false
,
Expr
,
value_guard
<
util
::
type_list
<>
>
,
util
::
type_list
<>
,
util
::
type_list
<>
>::
type
>
operator
>>
(
Expr
expr
)
const
{
typedef
typename
get_case
<
false
,
Expr
,
value_guard
<
util
::
type_list
<>
>
,
util
::
type_list
<>
,
util
::
type_list
<>
>::
type
result
;
return
result
{
typename
result
::
first_type
{},
typename
result
::
second_type
{
std
::
move
(
expr
),
value_guard
<
util
::
type_list
<>
>
{}}};
}
};
}
// namespace detail
constexpr
detail
::
on_the_fly_rvalue_builder
on_arg_match
;
#endif
}
// namespace cppa
...
...
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