Skip to content

Commit 75007dd

Browse files
authored
chore: rule of 3 for strdup guard (#3905)
1 parent 9bc2704 commit 75007dd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/pybind11/pybind11.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,10 @@ class cpp_function : public function {
312312
// along the way.
313313
class strdup_guard {
314314
public:
315+
strdup_guard() = default;
316+
strdup_guard(const strdup_guard &) = delete;
317+
strdup_guard &operator=(const strdup_guard &) = delete;
318+
315319
~strdup_guard() {
316320
for (auto *s : strings) {
317321
std::free(s);

0 commit comments

Comments
 (0)