[libcxx-commits] [libcxx] [libc++][concepts] P2404R3: Move-only types for equality_comparable_with, totally_ordered_with, and three_way_comparable_with (PR #99420)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jul 19 07:11:38 PDT 2024


================
@@ -1119,4 +1119,14 @@ static_assert(
     std::common_reference_with<one_way_ne const&, explicit_operators const&>);
 static_assert(
     !check_equality_comparable_with<one_way_ne, explicit_operators>());
+
+#if TEST_STD_VER < 23
+static_assert(!check_equality_comparable_with<move_only_equality_with_int, int>());
+static_assert(!check_equality_comparable_with<std::unique_ptr<int>, std::nullptr_t>());
+#else
+static_assert(check_equality_comparable_with<move_only_equality_with_int, int>());
+static_assert(check_equality_comparable_with<std::unique_ptr<int>, std::nullptr_t>());
----------------
ldionne wrote:

```suggestion
#else
// P2404
static_assert(check_equality_comparable_with<move_only_equality_with_int, int>());
static_assert(check_equality_comparable_with<std::unique_ptr<int>, std::nullptr_t>());
```

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


More information about the libcxx-commits mailing list