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
e5c88dfb
Commit
e5c88dfb
authored
Jan 07, 2013
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inlined apply_args function family
parent
39d26cad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
cppa/util/apply_args.hpp
cppa/util/apply_args.hpp
+6
-6
No files found.
cppa/util/apply_args.hpp
View file @
e5c88dfb
...
...
@@ -39,19 +39,19 @@
namespace
cppa
{
namespace
util
{
template
<
typename
F
,
class
Tuple
,
long
...
Is
>
auto
apply_args
(
F
&
f
,
Tuple
&
tup
,
util
::
int_list
<
Is
...
>
)
inline
auto
apply_args
(
F
&
f
,
Tuple
&
tup
,
util
::
int_list
<
Is
...
>
)
->
decltype
(
f
(
get_cv_aware
<
Is
>
(
tup
)...))
{
return
f
(
get_cv_aware
<
Is
>
(
tup
)...);
}
template
<
typename
F
,
class
Tuple
,
long
...
Is
,
typename
...
Args
>
auto
apply_args_prefixed
(
F
&
f
,
Tuple
&
tup
,
util
::
int_list
<
Is
...
>
,
Args
&&
...
args
)
inline
auto
apply_args_prefixed
(
F
&
f
,
Tuple
&
tup
,
util
::
int_list
<
Is
...
>
,
Args
&&
...
args
)
->
decltype
(
f
(
std
::
forward
<
Args
>
(
args
)...,
get_cv_aware
<
Is
>
(
tup
)...))
{
return
f
(
std
::
forward
<
Args
>
(
args
)...,
get_cv_aware
<
Is
>
(
tup
)...);
}
template
<
typename
F
,
class
Tuple
,
long
...
Is
,
typename
...
Args
>
auto
apply_args_suffxied
(
F
&
f
,
Tuple
&
tup
,
util
::
int_list
<
Is
...
>
,
Args
&&
...
args
)
inline
auto
apply_args_suffxied
(
F
&
f
,
Tuple
&
tup
,
util
::
int_list
<
Is
...
>
,
Args
&&
...
args
)
->
decltype
(
f
(
get_cv_aware
<
Is
>
(
tup
)...,
std
::
forward
<
Args
>
(
args
)...))
{
return
f
(
get_cv_aware
<
Is
>
(
tup
)...,
std
::
forward
<
Args
>
(
args
)...);
}
...
...
@@ -59,7 +59,7 @@ auto apply_args_suffxied(F& f, Tuple& tup, util::int_list<Is...>, Args&&... args
template
<
typename
Result
,
size_t
NumFunctorArgs
,
size_t
NumArgs
>
struct
partially_apply_helper
{
template
<
class
Fun
,
typename
Arg0
,
typename
...
Args
>
static
Result
_
(
const
Fun
&
fun
,
Arg0
&&
,
Args
&&
...
args
)
{
static
inline
Result
_
(
const
Fun
&
fun
,
Arg0
&&
,
Args
&&
...
args
)
{
return
partially_apply_helper
<
Result
,
NumFunctorArgs
,
sizeof
...(
Args
)
>
::
_
(
fun
,
std
::
forward
<
Args
>
(
args
)...);
}
...
...
@@ -68,13 +68,13 @@ struct partially_apply_helper {
template
<
typename
Result
,
size_t
X
>
struct
partially_apply_helper
<
Result
,
X
,
X
>
{
template
<
class
Fun
,
typename
...
Args
>
static
Result
_
(
const
Fun
&
fun
,
Args
&&
...
args
)
{
static
inline
Result
_
(
const
Fun
&
fun
,
Args
&&
...
args
)
{
return
fun
(
std
::
forward
<
Args
>
(
args
)...);
}
};
template
<
typename
Result
,
size_t
Num
,
typename
F
,
typename
...
Args
>
Result
partially_apply
(
F
&
f
,
Args
&&
...
args
)
{
inline
Result
partially_apply
(
F
&
f
,
Args
&&
...
args
)
{
return
partially_apply_helper
<
Result
,
Num
,
sizeof
...(
Args
)
>
::
_
(
f
,
std
::
forward
<
Args
>
(
args
)...);
}
...
...
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