Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
las3_pub
/
predictable_parallel_patterns
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6333222f
authored
Jul 30, 2019
by
FritzFlorian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add wrapper for class member function references.
parent
7e388ea8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
lib/pls/include/pls/internal/helpers/member_function.h
+35
-0
No files found.
lib/pls/include/pls/internal/helpers/member_function.h
0 → 100644
View file @
6333222f
#ifndef PLS_INTERNAL_HELPERS_MEMBER_FUNCTION_H_
#define PLS_INTERNAL_HELPERS_MEMBER_FUNCTION_H_
namespace
pls
{
namespace
internal
{
namespace
helpers
{
template
<
class
C
,
typename
R
,
typename
...
ARGS
>
class
member_function
{
public
:
using
type
=
member_function
<
C
,
R
,
ARGS
...
>
;
member_function
(
C
*
object
,
R
(
C
::*
function_pointer
)(
ARGS
...))
:
object_
{
object
},
function_pointer_
{
function_pointer
}
{}
R
operator
()(
ARGS
...
args
)
{
((
*
object_
).
*
function_pointer_
)(
args
...);
}
private
:
C
*
object_
;
R
(
C
::*
function_pointer_
)(
ARGS
...);
};
template
<
typename
C
,
typename
R
,
typename
...
ARGS
>
static
constexpr
member_function
<
C
,
R
,
ARGS
...
>
bind
(
C
*
object
,
R
(
C
::*
function_pointer
)(
ARGS
...))
{
return
{
object
,
function_pointer
};
}
}
}
}
#endif //PLS_INTERNAL_HELPERS_MEMBER_FUNCTION_H_
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