Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Özgür Ozan Sen
ogs
Commits
d7f2fdc0
Commit
d7f2fdc0
authored
8 years ago
by
Christoph Lehmann
Browse files
Options
Downloads
Patches
Plain Diff
[BL] try fix compile errors
parent
4b7ddd96
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
BaseLib/Functional.h
+13
-16
13 additions, 16 deletions
BaseLib/Functional.h
with
13 additions
and
16 deletions
BaseLib/Functional.h
+
13
−
16
View file @
d7f2fdc0
...
...
@@ -26,13 +26,10 @@ struct IndexedPlacedPlaceholder;
//! \param INDEX the integer value which is specialized
//! \param INDEX_P_1 "index plus one"; if INDEX_P_1 equals 1, then the member
//! value will be std::placeholders::_1, etc.
#define SPECIALIZE_INDEXEDPLACEHOLDER(INDEX, INDEX_P_1) \
template <> \
struct IndexedPlacedPlaceholder<(INDEX)> { \
static std::enable_if< \
std::is_placeholder<decltype( \
std::placeholders::_##INDEX_P_1)>::value, \
const decltype(std::placeholders::_##INDEX_P_1)>::type value; \
#define SPECIALIZE_INDEXEDPLACEHOLDER(INDEX, INDEX_P_1) \
template <> \
struct IndexedPlacedPlaceholder<(INDEX)> { \
static const decltype(std::placeholders::_##INDEX_P_1) value; \
}
// Create specializations up to the tenth placeholder
...
...
@@ -52,30 +49,30 @@ SPECIALIZE_INDEXEDPLACEHOLDER(9, 10);
// Note: The call sequence is easyBind() -> easyBind_inner() ->
// easyBind_innermost().
template
<
int
...
Indices
,
typename
Object
,
typename
M
et
hodClass
,
typename
ReturnType
,
typename
...
Args
>
template
<
int
...
Indices
,
typename
Object
,
typename
R
et
urnType
,
typename
...
Args
>
std
::
function
<
ReturnType
(
Args
...)
>
easyBind_innermost
(
ReturnType
(
MethodClass
::*
method
)(
Args
...),
Object
&
obj
)
ReturnType
(
Object
::*
method
)(
Args
...),
Object
&
obj
)
{
// std::ref makes sure that obj is not copied.
return
std
::
bind
(
method
,
std
::
ref
(
obj
),
IndexedPlacedPlaceholder
<
Indices
>::
value
...);
}
template
<
int
...
Indices
,
typename
Object
,
typename
M
et
hodClass
,
typename
ReturnType
,
typename
...
Args
>
template
<
int
...
Indices
,
typename
Object
,
typename
R
et
urnType
,
typename
...
Args
>
std
::
function
<
ReturnType
(
Args
...)
>
easyBind_innermost
(
ReturnType
(
MethodClass
::*
method
)(
Args
...)
const
,
Object
const
&
obj
)
ReturnType
(
Object
::*
method
)(
Args
...)
const
,
Object
const
&
obj
)
{
// std::cref makes sure that obj is not copied.
return
std
::
bind
(
method
,
std
::
cref
(
obj
),
IndexedPlacedPlaceholder
<
Indices
>::
value
...);
}
template
<
int
...
Indices
,
typename
Object
,
typename
M
et
hodClass
,
typename
ReturnType
,
typename
...
Args
>
template
<
int
...
Indices
,
typename
Object
,
typename
R
et
urnType
,
typename
...
Args
>
std
::
function
<
ReturnType
(
Args
...)
>
easyBind_innermost
(
ReturnType
(
MethodClass
::*
method
)(
Args
...)
const
,
Object
&
obj
)
ReturnType
(
Object
::*
method
)(
Args
...)
const
,
Object
&
obj
)
{
// std::cref makes sure that obj is not copied.
return
std
::
bind
(
method
,
std
::
cref
(
obj
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment