Skip to content

Commit 02d1d91

Browse files
committed
[libc++] P3379R1: Constrain 'std::expected' equality operators
1 parent 6d540b6 commit 02d1d91

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

libcxx/docs/ReleaseNotes/20.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Implemented Papers
4545
- ``std::jthread`` and ``<stop_token>`` are not guarded behind ``-fexperimental-library`` anymore
4646
- P2674R1: A trait for implicit lifetime types (`Github <https://github.com/llvm/llvm-project/issues/105259>`__)
4747
- P0429R9: A Standard ``flat_map`` is partially implemented and ``flat_map`` is provided (`Github <https://github.com/llvm/llvm-project/issues/105190>`__)
48+
- P3379R1: Constrain ``std::expected`` equality operators
4849

4950
Improvements and New Features
5051
-----------------------------

libcxx/test/std/utilities/expected/expected.expected/equality/equality.other_expected.pass.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,12 @@
2323
template <class T1, class T2>
2424
concept CanCompare = requires(T1 t1, T2 t2) { t1 == t2; };
2525

26-
struct Foo{};
26+
struct Foo {};
2727
static_assert(!CanCompare<Foo, Foo>);
2828

2929
static_assert(CanCompare<std::expected<int, int>, std::expected<int, int>>);
3030
static_assert(CanCompare<std::expected<int, int>, std::expected<short, short>>);
3131

32-
// Note this is true because other overloads are unconstrained
33-
static_assert(CanCompare<std::expected<int, int>, std::expected<void, int>>);
34-
3532
constexpr bool test() {
3633
// x.has_value() && y.has_value()
3734
{

0 commit comments

Comments
 (0)