[libcxx-commits] [libcxx] [libc++] Avoid type-punning between __Value_type and pair (PR #134819)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Wed Apr 9 19:12:27 PDT 2025


================
@@ -763,64 +763,7 @@ class __map_const_iterator;
 #  ifndef _LIBCPP_CXX03_LANG
 
 template <class _Key, class _Tp>
-struct _LIBCPP_STANDALONE_DEBUG __value_type {
-  typedef _Key key_type;
-  typedef _Tp mapped_type;
-  typedef pair<const key_type, mapped_type> value_type;
-  typedef pair<key_type&, mapped_type&> __nc_ref_pair_type;
-  typedef pair<key_type&&, mapped_type&&> __nc_rref_pair_type;
-
-private:
-  value_type __cc_;
-
-public:
-  _LIBCPP_HIDE_FROM_ABI value_type& __get_value() {
-#    if _LIBCPP_STD_VER >= 17
-    return *std::launder(std::addressof(__cc_));
----------------
frederick-vs-ja wrote:

It seems that we can avoid including `<__new/launder.h>` now.

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


More information about the libcxx-commits mailing list