[libcxx-commits] [libcxx] [libc++] P2944R3: Constrained comparisions - `variant` and `tuple` (PR #141396)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jun 23 02:39:11 PDT 2025


================
@@ -1153,9 +1154,16 @@ struct __tuple_equal<0> {
 };
 
 template <class... _Tp, class... _Up>
+#    if _LIBCPP_STD_VER >= 26
+  requires(requires(const _Tp& __t, const _Up& __u) {
+            { __t == __u } -> __boolean_testable;
+          } && ...) && (sizeof...(_Tp) == sizeof...(_Up))
----------------
philnik777 wrote:

I think we should use `__all` here. Otherwise we're potentially breaking currently working code, since fold expressions have a significantly lower limit than the number of allowed template arguments.

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


More information about the libcxx-commits mailing list