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
043e0dc4
Commit
043e0dc4
authored
Jul 03, 2012
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
maintenance
parent
7d70f1db
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
34 deletions
+12
-34
cppa/match_expr.hpp
cppa/match_expr.hpp
+12
-34
No files found.
cppa/match_expr.hpp
View file @
043e0dc4
...
@@ -462,10 +462,10 @@ template<typename Data>
...
@@ -462,10 +462,10 @@ template<typename Data>
struct
invoke_helper3
{
struct
invoke_helper3
{
const
Data
&
data
;
const
Data
&
data
;
invoke_helper3
(
const
Data
&
mdata
)
:
data
(
mdata
)
{
}
invoke_helper3
(
const
Data
&
mdata
)
:
data
(
mdata
)
{
}
template
<
size_t
P
os
,
typename
T
,
typename
...
Args
>
template
<
size_t
P
,
typename
T
,
typename
...
Args
>
inline
bool
operator
()(
util
::
type_pair
<
std
::
integral_constant
<
size_t
,
Pos
>
,
T
>
,
inline
bool
operator
()(
util
::
type_pair
<
std
::
integral_constant
<
size_t
,
P
>
,
T
>
,
Args
&&
...
args
)
const
{
Args
&&
...
args
)
const
{
const
auto
&
target
=
get
<
P
os
>
(
data
);
const
auto
&
target
=
get
<
P
>
(
data
);
return
target
.
first
(
target
.
second
,
std
::
forward
<
Args
>
(
args
)...);
return
target
.
first
(
target
.
second
,
std
::
forward
<
Args
>
(
args
)...);
//return (get<Pos>(data))(args...);
//return (get<Pos>(data))(args...);
}
}
...
@@ -474,7 +474,7 @@ struct invoke_helper3 {
...
@@ -474,7 +474,7 @@ struct invoke_helper3 {
template
<
class
Data
,
class
Token
,
class
Pattern
>
template
<
class
Data
,
class
Token
,
class
Pattern
>
struct
invoke_helper2
{
struct
invoke_helper2
{
typedef
Pattern
pattern_type
;
typedef
Pattern
pattern_type
;
typedef
typename
util
::
tl_filter_not_type
<
pattern_type
,
anything
>::
type
arg_types
;
typedef
typename
util
::
tl_filter_not_type
<
Pattern
,
anything
>::
type
arg_types
;
const
Data
&
data
;
const
Data
&
data
;
invoke_helper2
(
const
Data
&
mdata
)
:
data
(
mdata
)
{
}
invoke_helper2
(
const
Data
&
mdata
)
:
data
(
mdata
)
{
}
template
<
typename
...
Args
>
template
<
typename
...
Args
>
...
@@ -488,7 +488,8 @@ struct invoke_helper2 {
...
@@ -488,7 +488,8 @@ struct invoke_helper2 {
//static_assert(false, "foo");
//static_assert(false, "foo");
Token
token
;
Token
token
;
invoke_helper3
<
Data
>
fun
{
data
};
invoke_helper3
<
Data
>
fun
{
data
};
return
util
::
static_foreach
<
0
,
Token
::
size
>::
eval_or
(
token
,
fun
,
std
::
forward
<
Args
>
(
args
)...);
return
util
::
static_foreach
<
0
,
Token
::
size
>
::
eval_or
(
token
,
fun
,
std
::
forward
<
Args
>
(
args
)...);
}
}
};
};
...
@@ -497,7 +498,8 @@ template<typename Data>
...
@@ -497,7 +498,8 @@ template<typename Data>
struct
invoke_helper
{
struct
invoke_helper
{
const
Data
&
data
;
const
Data
&
data
;
std
::
uint64_t
bitfield
;
std
::
uint64_t
bitfield
;
invoke_helper
(
const
Data
&
mdata
,
std
::
uint64_t
bits
)
:
data
(
mdata
),
bitfield
(
bits
)
{
}
invoke_helper
(
const
Data
&
mdata
,
std
::
uint64_t
bits
)
:
data
(
mdata
),
bitfield
(
bits
)
{
}
// token: type_list<type_pair<integral_constant<size_t, X>,
// token: type_list<type_pair<integral_constant<size_t, X>,
// std::pair<projection, tpartial_function>>,
// std::pair<projection, tpartial_function>>,
// ...>
// ...>
...
@@ -849,30 +851,6 @@ inline match_expr<Lhs..., Rhs...> operator,(const match_expr<Lhs...>& lhs,
...
@@ -849,30 +851,6 @@ inline match_expr<Lhs..., Rhs...> operator,(const match_expr<Lhs...>& lhs,
return
lhs
.
or_else
(
rhs
);
return
lhs
.
or_else
(
rhs
);
}
}
/*
template<typename Arg0, typename... Args>
typename match_expr_from_type_list<
typename util::tl_concat<
typename Arg0::cases_list,
typename Args::cases_list...
>::type
>::type
mexpr_concat(const Arg0& arg0, const Args&... args) {
typename detail::tdata_from_type_list<
typename util::tl_map<
typename util::tl_concat<
typename Arg0::cases_list,
typename Args::cases_list...
>::type,
gref_wrapped
>::type
>::type
all_cases;
detail::collect_tdata(all_cases, arg0.cases(), args.cases()...);
return {all_cases};
}
*/
template
<
bool
HasTimeout
>
template
<
bool
HasTimeout
>
struct
match_expr_concat_impl
{
struct
match_expr_concat_impl
{
template
<
typename
Arg0
,
typename
...
Args
>
template
<
typename
Arg0
,
typename
...
Args
>
...
@@ -904,14 +882,14 @@ struct match_expr_concat_impl {
...
@@ -904,14 +882,14 @@ struct match_expr_concat_impl {
template
<
>
template
<
>
struct
match_expr_concat_impl
<
true
>
{
struct
match_expr_concat_impl
<
true
>
{
template
<
class
TData
,
typename
Cases
,
typename
F
>
template
<
class
TData
,
class
Token
,
typename
F
>
static
behavior_impl
*
__
(
const
TData
&
data
,
Cases
,
const
timeout_definition
<
F
>&
arg0
)
{
static
behavior_impl
*
__
(
const
TData
&
data
,
Token
,
const
timeout_definition
<
F
>&
arg0
)
{
typedef
typename
match_expr_from_type_list
<
Cases
>::
type
combined_type
;
typedef
typename
match_expr_from_type_list
<
Token
>::
type
combined_type
;
typedef
default_behavior_impl
<
combined_type
,
F
>
impl_type
;
typedef
default_behavior_impl
<
combined_type
,
F
>
impl_type
;
return
new
impl_type
(
data
,
arg0
);
return
new
impl_type
(
data
,
arg0
);
}
}
template
<
class
TData
,
typename
Token
,
typename
...
Cases
,
typename
...
Args
>
template
<
class
TData
,
class
Token
,
typename
...
Cases
,
typename
...
Args
>
static
behavior_impl
*
__
(
const
TData
&
data
,
Token
,
const
match_expr
<
Cases
...
>&
arg0
,
const
Args
&
...
args
)
{
static
behavior_impl
*
__
(
const
TData
&
data
,
Token
,
const
match_expr
<
Cases
...
>&
arg0
,
const
Args
&
...
args
)
{
typedef
typename
util
::
tl_concat
<
typedef
typename
util
::
tl_concat
<
Token
,
Token
,
...
...
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