[libcxx-commits] [libcxx] [libc++] P2944R3: Constrained comparisions - `optional` and `reference_wrapper` (PR #139368)
A. Jiang via libcxx-commits
libcxx-commits at lists.llvm.org
Fri May 30 03:16:29 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>
----------------
frederick-vs-ja wrote:
It seems better to split changes for `optional` comparison operators to another PR, so that we can proceed more quickly.
https://github.com/llvm/llvm-project/pull/139368
More information about the libcxx-commits
mailing list