[libcxx-commits] [libcxx] [libc++] P2255R2: Add deleted tuple constructor overloads (PR #205379)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Aug 21 01:11:52 PDT 2026
================
@@ -604,12 +604,38 @@ public:
: __base_(allocator_arg_t(), __a, __forward_args{}, __t...) {}
// tuple(U&& ...) constructors (including allocator_arg_t variants)
+ template <class... _Up>
+ struct _IsThisTuple : false_type {};
+ template <class _Up>
+ struct _IsThisTuple<_Up> : is_same<__remove_cvref_t<_Up>, tuple> {};
+
template <class... _Up>
struct _EnableUTypesCtor
- : _And<_Or<integral_constant<bool, sizeof...(_Up) != 1>,
- _IsNotSame<__remove_cvref_t<_Up...[0]>, tuple>>, // extension to allow mis-behaved user constructors
+ : _And<_Not<_IsThisTuple<_Up...> >, // extension to allow mis-behaved user constructors
is_constructible<_Tp, _Up>... > {};
+# if _LIBCPP_STD_VER >= 23
+ template <class... _Up>
+ static constexpr bool __has_danglings() {
----------------
philnik777 wrote:
```suggestion
static consteval bool __has_danglings() {
```
Not a huge fan of the name. When reading it my first question is "dangling what?".
https://github.com/llvm/llvm-project/pull/205379
More information about the libcxx-commits
mailing list