Skip to content

Commit

Permalink
Reapply 782630b minus the whitespace changes
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Sep 24, 2024
1 parent b67a7ea commit 590392b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions inst/include/cpp11/external_pointer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,15 @@ class external_pointer {
data_ = safe[Rf_shallow_duplicate](rhs.data_);
}

external_pointer(external_pointer&& rhs) { reset(rhs.release()); }
external_pointer(external_pointer&& rhs) {
data_ = rhs.data_;
rhs.data_ = R_NilValue;
}

external_pointer& operator=(external_pointer&& rhs) noexcept { reset(rhs.release()); }
external_pointer& operator=(external_pointer&& rhs) noexcept {
data_ = rhs.data_;
rhs.data_ = R_NilValue;
}

external_pointer& operator=(std::nullptr_t) noexcept { reset(); };

Expand Down

0 comments on commit 590392b

Please sign in to comment.