[libcxx-commits] [libcxx] [libc++] P2944R3: Constrained comparisions - `optional` and `reference_wrapper` (PR #139368)

Hristo Hristov via libcxx-commits libcxx-commits at lists.llvm.org
Mon May 12 01:40:00 PDT 2025


================
@@ -983,72 +984,133 @@ public:
 template <class _Tp>
 optional(_Tp) -> optional<_Tp>;
 
-// Comparisons between optionals
+// [optional.relops] Relational operators
+
+#    if _LIBCPP_STD_VER >= 26
+template < class _Tp, class _Up>
+#    else
 template <
     class _Tp,
     class _Up,
     enable_if_t<is_convertible_v<decltype(std::declval<const _Tp&>() == std::declval<const _Up&>()), bool>, int> = 0>
----------------
Zingam wrote:

Removing these constraints feel like the less painful option but I'll need a maintainer consensus on how to proceed.

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


More information about the libcxx-commits mailing list