diff --git a/tl/expected.hpp b/tl/expected.hpp index 79313ba..1a7190a 100644 --- a/tl/expected.hpp +++ b/tl/expected.hpp @@ -686,12 +686,13 @@ struct expected_operations_base : expected_storage_base { 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 - void construct_with(Rhs && rhs) noexcept { + void construct_with(Rhs &&) noexcept { this->m_has_val = true; } - template void construct_error(Args &&... args) noexcept { new (std::addressof(this->m_unexpect)) unexpected(std::forward(args)...); @@ -2056,38 +2057,6 @@ template constexpr bool operator!=(const unexpected &e, const expected &x) { return x.has_value() ? false : x.error() != e.value(); } -template -constexpr bool operator<(const expected &x, const unexpected &e) { - return false; -} -template -constexpr bool operator<(const unexpected &e, const expected &x) { - return x.has_value(); -} -template -constexpr bool operator<=(const expected &x, const unexpected &e) { - return !x.has_value(); -} -template -constexpr bool operator<=(const unexpected &e, const expected &x) { - return true; -} -template -constexpr bool operator>(const expected &x, const unexpected &e) { - return x.has_value(); -} -template -constexpr bool operator>(const unexpected &e, const expected &x) { - return false; -} -template -constexpr bool operator>=(const expected &x, const unexpected &e) { - return true; -} -template -constexpr bool operator>=(const unexpected &e, const expected &x) { - return !x.has_value(); -} // TODO is_swappable template