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
effba5fa
Commit
effba5fa
authored
Mar 03, 2012
by
neverlord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added match_types
parent
c0d66981
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
cppa/match.hpp
cppa/match.hpp
+12
-8
No files found.
cppa/match.hpp
View file @
effba5fa
...
...
@@ -36,6 +36,7 @@
#include "cppa/pattern.hpp"
#include "cppa/anything.hpp"
#include "cppa/any_tuple.hpp"
#include "cppa/util/type_list.hpp"
#include "cppa/detail/tuple_vals.hpp"
...
...
@@ -51,14 +52,6 @@ typedef std::integral_constant<wildcard_position,
wildcard_position
::
nil
>
no_wildcard
;
bool
tmatch
(
no_wildcard
,
std
::
type_info
const
*
tuple_value_type_list
,
any_tuple
::
const_iterator
const
&
tuple_begin
,
any_tuple
::
const_iterator
const
&
tuple_end
,
std
::
type_info
const
*
pattern_type_list
,
type_value_pair_const_iterator
pattern_begin
,
type_value_pair_const_iterator
pattern_end
);
}
// namespace detail
namespace
detail
{
...
...
@@ -117,6 +110,17 @@ inline bool match(any_tuple const& tup,
mv
);
}
/**
* @brief Matches types only (ignores all values of given pattern).
*/
template
<
typename
...
Ts
>
inline
bool
match_types
(
any_tuple
const
&
tup
,
pattern
<
Ts
...
>
const
&
)
{
typedef
util
::
type_list
<
Ts
...
>
tl
;
return
match_impl
<
get_wildcard_position
<
tl
>
(),
Ts
...
>::
_
(
tup
);
}
// implementation for zero or one wildcards
template
<
wildcard_position
PC
,
typename
...
Ts
>
struct
match_impl
...
...
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