From e7be9c2c2ea99382101764f3ccc183c61b40c68d Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Mon, 9 Oct 2023 07:35:33 -0700 Subject: [PATCH] Adopt suggestion by @tkoeppe: * https://github.com/pybind/pybind11/pull/4877#issuecomment-1752969127 * https://godbolt.org/z/Wa79nKz6e --- include/pybind11/numpy.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/pybind11/numpy.h b/include/pybind11/numpy.h index cb0e8a4e2..62768adce 100644 --- a/include/pybind11/numpy.h +++ b/include/pybind11/numpy.h @@ -71,6 +71,13 @@ public: PYBIND11_WARNING_POP } + constexpr LazyInitializeAtLeastOnceDestroyNever() = default; +#if __cplusplus >= 202002L + constexpr +#endif // C++20 + ~LazyInitializeAtLeastOnceDestroyNever() + = default; + private: alignas(T) char value_storage_[sizeof(T)]; bool initialized_ = false;