Merge branch 'master' of github.com:TartanLlama/expected

This commit is contained in:
Simon Brand
2018-02-17 08:44:49 +00:00

View File

@@ -1984,19 +1984,19 @@ constexpr bool operator!=(const U &v, const expected<T, E> &x) {
template <class T, class E>
constexpr bool operator==(const expected<T, E> &x, const unexpected<E> &e) {
return x.has_value() ? true : x.error() == e.value();
return x.has_value() ? false : x.error() == e.value();
}
template <class T, class E>
constexpr bool operator==(const unexpected<E> &e, const expected<T, E> &x) {
return x.has_value() ? true : x.error() == e.value();
return x.has_value() ? false : x.error() == e.value();
}
template <class T, class E>
constexpr bool operator!=(const expected<T, E> &x, const unexpected<E> &e) {
return x.has_value() ? false : x.error() != e.value();
return x.has_value() ? true : x.error() != e.value();
}
template <class T, class E>
constexpr bool operator!=(const unexpected<E> &e, const expected<T, E> &x) {
return x.has_value() ? false : x.error() != e.value();
return x.has_value() ? true : x.error() != e.value();
}
// TODO is_swappable