We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7cacaad commit 4ce1313Copy full SHA for 4ce1313
libcxx/include/__utility/no_destroy.h
@@ -30,7 +30,12 @@ struct __uninitialized_tag {};
30
// initialization using __emplace.
31
template <class _Tp>
32
struct __no_destroy {
33
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __no_destroy(__uninitialized_tag) : __obj_() {}
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __no_destroy(__uninitialized_tag) {
34
+ if (__libcpp_is_constant_evaluated()) {
35
+ for (size_t __i = 0; __i != sizeof(__obj_); ++__i)
36
+ std::construct_at(__obj_ + __i);
37
+ }
38
39
40
template <class... _Args>
41
_LIBCPP_HIDE_FROM_ABI explicit __no_destroy(_Args&&... __args) {
0 commit comments