[libcxx-commits] [libcxx] [libc++] P2255R2: Add deleted tuple constructor overloads (PR #205379)
Yihan Wang via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Aug 15 02:06:51 PDT 2026
================
@@ -616,21 +616,83 @@ public:
_Not<_IsThisTuple<_Up...> >, // extension to allow mis-behaved user constructors
is_constructible<_Tp, _Up>... > {};
- template <class... _Up,
- __enable_if_t< _And< _BoolConstant<sizeof...(_Up) == sizeof...(_Tp)>, _EnableUTypesCtor<_Up...> >::value,
- int> = 0>
+ template <class... _Up>
+ struct _EnableUTypesCtorBase : _And<_BoolConstant<sizeof...(_Up) == sizeof...(_Tp)>, _EnableUTypesCtor<_Up...> > {};
+
+ template <bool, class... _Up>
+ struct _EnableUTypesCtorNoDangling : false_type {};
+
+# if _LIBCPP_STD_VER >= 23
+ template <class... _Up>
+ static constexpr bool __has_danglings() {
+ if constexpr (sizeof...(_Up) == sizeof...(_Tp))
+ return (__reference_constructs_from_temporary_v<_Tp, _Up&&> || ...);
+ else
+ return false;
+ }
+
+ template <class _Source, class _DecayedSource = __remove_cvref_t<_Source> >
+ static inline constexpr bool __has_danglings_from_tuple_like = false;
----------------
yronglin wrote:
Done.
https://github.com/llvm/llvm-project/pull/205379
More information about the libcxx-commits
mailing list