Description
WG21-P3037R4 "constexpr
std::shared_ptr
" has been recently forwarded to LWG for C++26. The paper currently also makes (in)out_ptr_t
constexpr
, including their operator void**()
conversion functions.
It seems that the non-trivial changes, probably including changing the type of some data members, are necessary for constexpr
-compatibility (e.g. avoiding UB, reinterpret_cast
, and bit_cast
involving pointers). Before C++23 ABI freeze of MSVC STL, we might need to determine and switch to use a suitable implementation strategy for (in)out_ptr_t
to avoid undesired ABI breakage.
IMO we might need to switch to use union to store raw pointers (along with void*
when necessary), while using std::is_within_lifetime
to detect the active member during constant evaluation (although the compiler support from MSVC is not yet available now).