Skip to content

Commit

Permalink
Semi-paranoid placement new (based on #4877 (comment)).
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralf W. Grosse-Kunstleve committed Oct 9, 2023
1 parent 6d9441d commit a864f21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/pybind11/numpy.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class LazyInitializeAtLeastOnceDestroyNever {
assert(PyGILState_Check());
auto value = initialize();
if (!initialized_) {
new (reinterpret_cast<T *>(value_storage_)) T(std::move(value));
::new (value_storage_) T(std::move(value));
initialized_ = true;
}
}
Expand Down

0 comments on commit a864f21

Please sign in to comment.