[libcxx-commits] [libcxx] [libc++] Remove _IsThisTuple (PR #213909)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Tue Aug 4 04:23:11 PDT 2026


https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/213909

We can inline it into `_EnableUTypesCtor` instead.


>From d40f2efa237bfd730ea5ad82b26a40b2b3ddbd73 Mon Sep 17 00:00:00 2001
From: Nikolas Klauser <nikolasklauser at berlin.de>
Date: Tue, 4 Aug 2026 13:22:08 +0200
Subject: [PATCH] [libc++] Remove _IsThisTuple

---
 libcxx/include/tuple | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/libcxx/include/tuple b/libcxx/include/tuple
index 2f0127bc7388d..b3f4ac92ccd4a 100644
--- a/libcxx/include/tuple
+++ b/libcxx/include/tuple
@@ -604,14 +604,10 @@ 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<_Not<_IsThisTuple<_Up...> >, // extension to allow mis-behaved user constructors
+      : _And<_Or<integral_constant<bool, sizeof...(_Up) != 1>,
+                 _IsNotSame<__remove_cvref_t<_Up...[0]>, tuple>>, // extension to allow mis-behaved user constructors
              is_constructible<_Tp, _Up>... > {};
 
   template <class... _Up,



More information about the libcxx-commits mailing list