mirror of
https://github.com/RYDE-WORK/pybind11.git
synced 2026-02-02 13:15:52 +08:00
chore: rule of 3 for strdup guard (#3905)
This commit is contained in:
parent
9bc2704430
commit
75007dda72
@ -312,6 +312,10 @@ protected:
|
|||||||
// along the way.
|
// along the way.
|
||||||
class strdup_guard {
|
class strdup_guard {
|
||||||
public:
|
public:
|
||||||
|
strdup_guard() = default;
|
||||||
|
strdup_guard(const strdup_guard &) = delete;
|
||||||
|
strdup_guard &operator=(const strdup_guard &) = delete;
|
||||||
|
|
||||||
~strdup_guard() {
|
~strdup_guard() {
|
||||||
for (auto *s : strings) {
|
for (auto *s : strings) {
|
||||||
std::free(s);
|
std::free(s);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user