Skip to content

Commit a864f21

Browse files
committed
Semi-paranoid placement new (based on #4877 (comment)).
1 parent 6d9441d commit a864f21

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/pybind11/numpy.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class LazyInitializeAtLeastOnceDestroyNever {
6666
assert(PyGILState_Check());
6767
auto value = initialize();
6868
if (!initialized_) {
69-
new (reinterpret_cast<T *>(value_storage_)) T(std::move(value));
69+
::new (value_storage_) T(std::move(value));
7070
initialized_ = true;
7171
}
7272
}

0 commit comments

Comments
 (0)