Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
74d335a5
Commit
74d335a5
authored
Jul 10, 2019
by
Toru Niina
Committed by
Wenzel Jakob
Jul 10, 2019
Browse files
Replace a usage of C++14 language features with C++11 code (#1833)
parent
9fd47121
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
include/pybind11/functional.h
include/pybind11/functional.h
+12
-5
No files found.
include/pybind11/functional.h
View file @
74d335a5
...
@@ -65,12 +65,19 @@ public:
...
@@ -65,12 +65,19 @@ public:
}
}
};
};
value
=
[
hfunc
=
func_handle
(
std
::
move
(
func
))](
Args
...
args
)
->
Return
{
// to emulate 'move initialization capture' in C++11
struct
func_wrapper
{
func_handle
hfunc
;
func_wrapper
(
func_handle
&&
hf
)
:
hfunc
(
std
::
move
(
hf
))
{}
Return
operator
()(
Args
...
args
)
const
{
gil_scoped_acquire
acq
;
gil_scoped_acquire
acq
;
object
retval
(
hfunc
.
f
(
std
::
forward
<
Args
>
(
args
)...));
object
retval
(
hfunc
.
f
(
std
::
forward
<
Args
>
(
args
)...));
/* Visual studio 2015 parser issue: need parentheses around this expression */
/* Visual studio 2015 parser issue: need parentheses around this expression */
return
(
retval
.
template
cast
<
Return
>());
return
(
retval
.
template
cast
<
Return
>());
}
};
};
value
=
func_wrapper
(
func_handle
(
std
::
move
(
func
)));
return
true
;
return
true
;
}
}
...
...
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