mirror of
https://github.com/TartanLlama/expected.git
synced 2025-08-03 10:54:31 +02:00
Remove expected to unexpected orderings
This commit is contained in:
@@ -686,12 +686,13 @@ struct expected_operations_base<void,E> : expected_storage_base<void, E> {
|
|||||||
this->m_has_val = true;
|
this->m_has_val = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This function doesn't use its argument, but needs it so that code in
|
||||||
|
// levels above this can work independently of whether T is void
|
||||||
template <class Rhs>
|
template <class Rhs>
|
||||||
void construct_with(Rhs && rhs) noexcept {
|
void construct_with(Rhs &&) noexcept {
|
||||||
this->m_has_val = true;
|
this->m_has_val = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <class... Args> void construct_error(Args &&... args) noexcept {
|
template <class... Args> void construct_error(Args &&... args) noexcept {
|
||||||
new (std::addressof(this->m_unexpect))
|
new (std::addressof(this->m_unexpect))
|
||||||
unexpected<E>(std::forward<Args>(args)...);
|
unexpected<E>(std::forward<Args>(args)...);
|
||||||
@@ -2056,38 +2057,6 @@ template <class T, class E>
|
|||||||
constexpr bool operator!=(const unexpected<E> &e, const expected<T, E> &x) {
|
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() ? false : x.error() != e.value();
|
||||||
}
|
}
|
||||||
template <class T, class E>
|
|
||||||
constexpr bool operator<(const expected<T, E> &x, const unexpected<E> &e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
template <class T, class E>
|
|
||||||
constexpr bool operator<(const unexpected<E> &e, const expected<T, E> &x) {
|
|
||||||
return x.has_value();
|
|
||||||
}
|
|
||||||
template <class T, class E>
|
|
||||||
constexpr bool operator<=(const expected<T, E> &x, const unexpected<E> &e) {
|
|
||||||
return !x.has_value();
|
|
||||||
}
|
|
||||||
template <class T, class E>
|
|
||||||
constexpr bool operator<=(const unexpected<E> &e, const expected<T, E> &x) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
template <class T, class E>
|
|
||||||
constexpr bool operator>(const expected<T, E> &x, const unexpected<E> &e) {
|
|
||||||
return x.has_value();
|
|
||||||
}
|
|
||||||
template <class T, class E>
|
|
||||||
constexpr bool operator>(const unexpected<E> &e, const expected<T, E> &x) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
template <class T, class E>
|
|
||||||
constexpr bool operator>=(const expected<T, E> &x, const unexpected<E> &e) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
template <class T, class E>
|
|
||||||
constexpr bool operator>=(const unexpected<E> &e, const expected<T, E> &x) {
|
|
||||||
return !x.has_value();
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO is_swappable
|
// TODO is_swappable
|
||||||
template <class T, class E,
|
template <class T, class E,
|
||||||
|
Reference in New Issue
Block a user