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
a7c57cea
Commit
a7c57cea
authored
Apr 02, 2012
by
neverlord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix
parent
b88d7229
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
7 deletions
+23
-7
unit_testing/main.cpp
unit_testing/main.cpp
+23
-7
No files found.
unit_testing/main.cpp
View file @
a7c57cea
...
@@ -112,6 +112,12 @@ inline bool found_key(Iterator& i, Container& cont, Key&& key)
...
@@ -112,6 +112,12 @@ inline bool found_key(Iterator& i, Container& cont, Key&& key)
return
(
i
=
cont
.
find
(
std
::
forward
<
Key
>
(
key
)))
!=
cont
.
end
();
return
(
i
=
cont
.
find
(
std
::
forward
<
Key
>
(
key
)))
!=
cont
.
end
();
}
}
template
<
typename
F
,
typename
S
>
any_tuple
to_tuple
(
std
::
pair
<
F
,
S
>
const
&
p
)
{
return
make_tuple
(
p
.
first
,
p
.
second
);
}
struct
match_helper
struct
match_helper
{
{
any_tuple
tup
;
any_tuple
tup
;
...
@@ -127,9 +133,25 @@ struct match_helper
...
@@ -127,9 +133,25 @@ struct match_helper
template
<
typename
F
,
typename
S
>
template
<
typename
F
,
typename
S
>
match_helper
match
(
std
::
pair
<
F
,
S
>
const
&
what
)
match_helper
match
(
std
::
pair
<
F
,
S
>
const
&
what
)
{
{
return
{
make_tuple
(
what
.
first
,
what
.
second
)};
return
{
to_tuple
(
what
)};
}
}
template
<
class
Container
>
struct
match_each_helper
{
Container
const
&
args
;
template
<
typename
...
Args
>
void
operator
()(
partial_function
&&
pf
,
Args
&&
...
args
)
{
partial_function
tmp
;
tmp
.
splice
(
std
::
move
(
pf
),
std
::
forward
<
Args
>
(
args
)...);
for
(
auto
&
arg
:
args
)
{
tmp
(
to_tuple
(
arg
));
}
}
};
void
usage
(
char
const
*
argv0
)
void
usage
(
char
const
*
argv0
)
{
{
cout
<<
"usage: "
<<
split
(
argv0
,
'/'
).
back
()
<<
" "
cout
<<
"usage: "
<<
split
(
argv0
,
'/'
).
back
()
<<
" "
...
@@ -170,12 +192,6 @@ int main(int argc, char** argv)
...
@@ -170,12 +192,6 @@ int main(int argc, char** argv)
cerr
<<
"unknown scheduler: "
<<
sched
<<
endl
;
cerr
<<
"unknown scheduler: "
<<
sched
<<
endl
;
exit
(
1
);
exit
(
1
);
}
}
},
on_arg_match
>>
[
&
](
std
::
string
const
&
key
,
std
::
string
const
&
)
{
cerr
<<
"unknown key:
\"
"
<<
key
<<
"
\"
"
<<
endl
;
usage
(
argv
[
0
]);
exit
(
2
);
}
}
);
);
}
}
...
...
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