diff --git a/proxy.h b/proxy.h index f25c531..f54b139 100644 --- a/proxy.h +++ b/proxy.h @@ -791,9 +791,12 @@ class proxy : public details::facade_traits::direct_accessor { private: template P& initialize(Args&&... args) { - std::construct_at(reinterpret_cast(ptr_), std::forward(args)...); + P& result = *std::construct_at( + reinterpret_cast(ptr_), std::forward(args)...); + if constexpr (requires { (bool)result; }) + { assert((bool)result); } meta_ = details::meta_ptr{std::in_place_type

}; - return *std::launder(reinterpret_cast(ptr_)); + return result; } [[___PRO_NO_UNIQUE_ADDRESS_ATTRIBUTE]]