mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-25 14:45:12 +00:00
Adopt suggestion by @tkoeppe:
* https://github.com/pybind/pybind11/pull/4877#issuecomment-1752969127 * https://godbolt.org/z/Wa79nKz6e
This commit is contained in:
parent
1ce27154d6
commit
e7be9c2c2e
@ -71,6 +71,13 @@ public:
|
|||||||
PYBIND11_WARNING_POP
|
PYBIND11_WARNING_POP
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr LazyInitializeAtLeastOnceDestroyNever() = default;
|
||||||
|
#if __cplusplus >= 202002L
|
||||||
|
constexpr
|
||||||
|
#endif // C++20
|
||||||
|
~LazyInitializeAtLeastOnceDestroyNever()
|
||||||
|
= default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
alignas(T) char value_storage_[sizeof(T)];
|
alignas(T) char value_storage_[sizeof(T)];
|
||||||
bool initialized_ = false;
|
bool initialized_ = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user