mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-29 00:22:00 +00:00
fix: func_handle for rule of two (#3169)
* Fix func_handle for rule of two * Apply reviewer suggestion
This commit is contained in:
parent
ada6b79104
commit
9f204a1857
@ -70,9 +70,11 @@ public:
|
|||||||
struct func_handle {
|
struct func_handle {
|
||||||
function f;
|
function f;
|
||||||
func_handle(function &&f_) noexcept : f(std::move(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;
|
gil_scoped_acquire acq;
|
||||||
f = f_.f;
|
f = f_.f;
|
||||||
|
return *this;
|
||||||
}
|
}
|
||||||
~func_handle() {
|
~func_handle() {
|
||||||
gil_scoped_acquire acq;
|
gil_scoped_acquire acq;
|
||||||
|
Loading…
Reference in New Issue
Block a user