[libcxx-commits] [libcxx] [libc++][ABI BREAK] Make std::pair trivially copyable if its members are (PR #89652)

Michael Schellenberger Costa via libcxx-commits libcxx-commits at lists.llvm.org
Fri Apr 26 05:32:59 PDT 2024


================
@@ -141,6 +142,31 @@ struct _LIBCPP_TEMPLATE_VIS pair
       _NOEXCEPT_(is_nothrow_copy_constructible<first_type>::value&& is_nothrow_copy_constructible<second_type>::value)
       : first(__t1), second(__t2) {}
 
+  // Make pair trivially copyable if we have a way to do it
----------------
miscco wrote:

We "solved" this with a base class in libcu++, which has the benefit of not relying on compiler intrinsics:

https://github.com/NVIDIA/cccl/blob/7bfd9401458f22b127a29515359bd4d4b68a22e3/libcudacxx/include/cuda/std/__utility/pair.h#L118-L140

https://github.com/llvm/llvm-project/pull/89652


More information about the libcxx-commits mailing list