From 75007dda72ad4508064c1f080394eae50d3a61ee Mon Sep 17 00:00:00 2001 From: Aaron Gokaslan Date: Tue, 26 Apr 2022 15:49:24 -0400 Subject: [PATCH] chore: rule of 3 for strdup guard (#3905) --- include/pybind11/pybind11.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index ce05b6e4e..e828f725d 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -312,6 +312,10 @@ protected: // along the way. class strdup_guard { public: + strdup_guard() = default; + strdup_guard(const strdup_guard &) = delete; + strdup_guard &operator=(const strdup_guard &) = delete; + ~strdup_guard() { for (auto *s : strings) { std::free(s);