mirror of
https://github.com/TartanLlama/expected.git
synced 2025-08-03 02:44:30 +02:00
Fix #10
This commit is contained in:
@@ -1965,32 +1965,6 @@ constexpr bool operator!=(const expected<T, E> &lhs,
|
|||||||
? true
|
? true
|
||||||
: (!lhs.has_value() ? lhs.error() != rhs.error() : *lhs != *rhs);
|
: (!lhs.has_value() ? lhs.error() != rhs.error() : *lhs != *rhs);
|
||||||
}
|
}
|
||||||
template <class T, class E, class U, class F>
|
|
||||||
constexpr bool operator<(const expected<T, E> &lhs, const expected<U, F> &rhs) {
|
|
||||||
return (lhs.has_value() != rhs.has_value())
|
|
||||||
? (!lhs.has_value() ? true : false)
|
|
||||||
: (!lhs.has_value() ? lhs.error() < rhs.error() : *lhs < *rhs);
|
|
||||||
}
|
|
||||||
template <class T, class E, class U, class F>
|
|
||||||
constexpr bool operator>(const expected<T, E> &lhs, const expected<U, F> &rhs) {
|
|
||||||
return (lhs.has_value() != rhs.has_value())
|
|
||||||
? (!lhs.has_value() ? false : true)
|
|
||||||
: (!lhs.has_value() ? lhs.error() > rhs.error() : *lhs > *rhs);
|
|
||||||
}
|
|
||||||
template <class T, class E, class U, class F>
|
|
||||||
constexpr bool operator<=(const expected<T, E> &lhs,
|
|
||||||
const expected<U, F> &rhs) {
|
|
||||||
return (lhs.has_value() != rhs.has_value())
|
|
||||||
? (!lhs.has_value() ? false : true)
|
|
||||||
: (!lhs.has_value() ? lhs.error() <= rhs.error() : *lhs <= *rhs);
|
|
||||||
}
|
|
||||||
template <class T, class E, class U, class F>
|
|
||||||
constexpr bool operator>=(const expected<T, E> &lhs,
|
|
||||||
const expected<U, F> &rhs) {
|
|
||||||
return (lhs.has_value() != rhs.has_value())
|
|
||||||
? (!lhs.has_value() ? true : false)
|
|
||||||
: (!lhs.has_value() ? lhs.error() >= rhs.error() : *lhs >= *rhs);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T, class E, class U>
|
template <class T, class E, class U>
|
||||||
constexpr bool operator==(const expected<T, E> &x, const U &v) {
|
constexpr bool operator==(const expected<T, E> &x, const U &v) {
|
||||||
@@ -2008,38 +1982,6 @@ template <class T, class E, class U>
|
|||||||
constexpr bool operator!=(const U &v, const expected<T, E> &x) {
|
constexpr bool operator!=(const U &v, const expected<T, E> &x) {
|
||||||
return x.has_value() ? *x != v : true;
|
return x.has_value() ? *x != v : true;
|
||||||
}
|
}
|
||||||
template <class T, class E, class U>
|
|
||||||
constexpr bool operator<(const expected<T, E> &x, const U &v) {
|
|
||||||
return x.has_value() ? *x < v : true;
|
|
||||||
}
|
|
||||||
template <class T, class E, class U>
|
|
||||||
constexpr bool operator<(const U &v, const expected<T, E> &x) {
|
|
||||||
return x.has_value() ? v < *x : false;
|
|
||||||
}
|
|
||||||
template <class T, class E, class U>
|
|
||||||
constexpr bool operator<=(const expected<T, E> &x, const U &v) {
|
|
||||||
return x.has_value() ? *x <= v : true;
|
|
||||||
}
|
|
||||||
template <class T, class E, class U>
|
|
||||||
constexpr bool operator<=(const U &v, const expected<T, E> &x) {
|
|
||||||
return x.has_value() ? v <= *x : false;
|
|
||||||
}
|
|
||||||
template <class T, class E, class U>
|
|
||||||
constexpr bool operator>(const expected<T, E> &x, const U &v) {
|
|
||||||
return x.has_value() ? *x > v : false;
|
|
||||||
}
|
|
||||||
template <class T, class E, class U>
|
|
||||||
constexpr bool operator>(const U &v, const expected<T, E> &x) {
|
|
||||||
return x.has_value() ? v > *x : true;
|
|
||||||
}
|
|
||||||
template <class T, class E, class U>
|
|
||||||
constexpr bool operator>=(const expected<T, E> &x, const U &v) {
|
|
||||||
return x.has_value() ? *x >= v : false;
|
|
||||||
}
|
|
||||||
template <class T, class E, class U>
|
|
||||||
constexpr bool operator>=(const U &v, const expected<T, E> &x) {
|
|
||||||
return x.has_value() ? v >= *x : true;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T, class E>
|
template <class T, class E>
|
||||||
constexpr bool operator==(const expected<T, E> &x, const unexpected<E> &e) {
|
constexpr bool operator==(const expected<T, E> &x, const unexpected<E> &e) {
|
||||||
|
Reference in New Issue
Block a user