Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion include/zeus/expected.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,15 @@ class unexpected
friend constexpr void swap(unexpected &x, unexpected &y) noexcept(noexcept(x.swap(y))) { x.swap(y); }

template<class E2>
friend constexpr bool operator==(const unexpected &lhs, const unexpected<E2> &rhs) noexcept(noexcept(lhs.error() == rhs.error()))
friend constexpr bool operator==(
const unexpected &lhs, const unexpected<E2> &rhs
) noexcept(expected_detail::is_nothrow_equality_result_convertible_to_bool_v<E, E2>)
{
// [expected.un.eq] Mandates
static_assert(
expected_detail::is_equality_result_convertible_to_bool_v<E, E2>,
"The expression lhs.error() == rhs.error() must be well-formed and its result must be convertible to bool"
);
return lhs.error() == rhs.error();
}
template<class E2>
Expand Down