Fix bug in unequal operator with void as expected value (#156)

This commit is contained in:
Bojan Strbac
2025-01-21 10:47:24 +01:00
committed by GitHub
parent 735634d78b
commit a0ef772cbe

View File

@@ -2392,7 +2392,7 @@ constexpr bool operator!=(const expected<void, E> &lhs,
const expected<void, F> &rhs) {
return (lhs.has_value() != rhs.has_value())
? true
: (!lhs.has_value() ? lhs.error() == rhs.error() : false);
: (!lhs.has_value() ? lhs.error() != rhs.error() : false);
}
template <class T, class E, class U>