This commit is contained in:
Simon Brand
2018-01-05 08:56:59 +00:00
parent 3adfec7ffc
commit dea5274cd2

View File

@@ -1965,32 +1965,6 @@ constexpr bool operator!=(const expected<T, E> &lhs,
? 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, 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>
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) {
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>
constexpr bool operator==(const expected<T, E> &x, const unexpected<E> &e) {