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
36fcc689
Commit
36fcc689
authored
Jan 17, 2012
by
neverlord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed range check
parent
2e31f099
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
cppa/pattern.hpp
cppa/pattern.hpp
+11
-2
No files found.
cppa/pattern.hpp
View file @
36fcc689
...
@@ -41,6 +41,7 @@
...
@@ -41,6 +41,7 @@
#include "cppa/util/tbind.hpp"
#include "cppa/util/tbind.hpp"
#include "cppa/util/type_list.hpp"
#include "cppa/util/type_list.hpp"
#include "cppa/util/arg_match_t.hpp"
#include "cppa/detail/boxed.hpp"
#include "cppa/detail/boxed.hpp"
#include "cppa/detail/tdata.hpp"
#include "cppa/detail/tdata.hpp"
...
@@ -129,13 +130,21 @@ class pattern
...
@@ -129,13 +130,21 @@ class pattern
template
<
typename
Arg0
,
typename
...
Args
>
template
<
typename
Arg0
,
typename
...
Args
>
pattern
(
Arg0
const
&
arg0
,
Args
const
&
...
args
)
:
m_data
(
arg0
,
args
...)
pattern
(
Arg0
const
&
arg0
,
Args
const
&
...
args
)
:
m_data
(
arg0
,
args
...)
{
{
using
std
::
is_same
;
using
namespace
util
;
typedef
typename
type_list
<
Arg0
,
Args
...
>::
back
arg_n
;
static
constexpr
bool
ignore_arg_n
=
is_same
<
arg_n
,
arg_match_t
>::
value
;
bool
invalid_args
[]
=
{
detail
::
is_boxed
<
Arg0
>::
value
,
bool
invalid_args
[]
=
{
detail
::
is_boxed
<
Arg0
>::
value
,
detail
::
is_boxed
<
Args
>::
value
...
};
detail
::
is_boxed
<
Args
>::
value
...
};
for
(
size_t
i
=
0
;
i
<
sizeof
...(
Args
)
+
1
;
++
i
)
// ignore extra arg_match_t argument
static
constexpr
size_t
args_size
=
sizeof
...(
Args
)
+
(
ignore_arg_n
?
0
:
1
);
static_assert
(
args_size
<=
size
,
"too many arguments"
);
for
(
size_t
i
=
0
;
i
<
args_size
;
++
i
)
{
{
m_data_ptr
[
i
]
=
invalid_args
[
i
]
?
nullptr
:
m_data
.
at
(
i
);
m_data_ptr
[
i
]
=
invalid_args
[
i
]
?
nullptr
:
m_data
.
at
(
i
);
}
}
for
(
size_t
i
=
sizeof
...(
Args
)
+
1
;
i
<
size
;
++
i
)
for
(
size_t
i
=
args_size
;
i
<
size
;
++
i
)
{
{
m_data_ptr
[
i
]
=
nullptr
;
m_data_ptr
[
i
]
=
nullptr
;
}
}
...
...
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