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
c0756ccd
Unverified
Commit
c0756ccd
authored
Aug 03, 2021
by
Aaron Gokaslan
Committed by
GitHub
Aug 03, 2021
Browse files
fix: func_handle for rule of two (#3169)
* Fix func_handle for rule of two * Apply reviewer suggestion
parent
f4f4632e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
include/pybind11/functional.h
include/pybind11/functional.h
+3
-1
No files found.
include/pybind11/functional.h
View file @
c0756ccd
...
...
@@ -70,9 +70,11 @@ public:
struct
func_handle
{
function
f
;
func_handle
(
function
&&
f_
)
noexcept
:
f
(
std
::
move
(
f_
))
{}
func_handle
(
const
func_handle
&
f_
)
{
func_handle
(
const
func_handle
&
f_
)
{
operator
=
(
f_
);
}
func_handle
&
operator
=
(
const
func_handle
&
f_
)
{
gil_scoped_acquire
acq
;
f
=
f_
.
f
;
return
*
this
;
}
~
func_handle
()
{
gil_scoped_acquire
acq
;
...
...
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