Lines Matching defs:rhs
1947 constexpr bool operator==(const unexpected<E> &lhs, const unexpected<E> &rhs) {
1948 return lhs.value() == rhs.value();
1951 constexpr bool operator!=(const unexpected<E> &lhs, const unexpected<E> &rhs) {
1952 return lhs.value() != rhs.value();
1955 constexpr bool operator<(const unexpected<E> &lhs, const unexpected<E> &rhs) {
1956 return lhs.value() < rhs.value();
1959 constexpr bool operator<=(const unexpected<E> &lhs, const unexpected<E> &rhs) {
1960 return lhs.value() <= rhs.value();
1963 constexpr bool operator>(const unexpected<E> &lhs, const unexpected<E> &rhs) {
1964 return lhs.value() > rhs.value();
1967 constexpr bool operator>=(const unexpected<E> &lhs, const unexpected<E> &rhs) {
1968 return lhs.value() >= rhs.value();
2499 void construct_with(Rhs &&rhs) noexcept {
2500 new (std::addressof(this->m_val)) T(std::forward<Rhs>(rhs).get());
2515 // The problematic case is where rhs has a value, but *this does not.
2522 void assign(const expected_operations_base &rhs) noexcept {
2523 if (!this->m_has_val && rhs.m_has_val) {
2525 construct(rhs.get());
2527 assign_common(rhs);
2537 void assign(const expected_operations_base &rhs) noexcept {
2538 if (!this->m_has_val && rhs.m_has_val) {
2539 T tmp = rhs.get();
2543 assign_common(rhs);
2556 void assign(const expected_operations_base &rhs) {
2557 if (!this->m_has_val && rhs.m_has_val) {
2563 construct(rhs.get());
2569 construct(rhs.get());
2572 assign_common(rhs);
2580 void assign(expected_operations_base &&rhs) noexcept {
2581 if (!this->m_has_val && rhs.m_has_val) {
2583 construct(std::move(rhs).get());
2585 assign_common(std::move(rhs));
2592 void assign(expected_operations_base &&rhs) {
2593 if (!this->m_has_val && rhs.m_has_val) {
2598 construct(std::move(rhs).get());
2604 construct(std::move(rhs).get());
2607 assign_common(std::move(rhs));
2614 void assign(const expected_operations_base &rhs) noexcept {
2615 if (!this->m_has_val && rhs.m_has_val) {
2617 construct(rhs.get());
2619 assign_common(rhs);
2623 void assign(expected_operations_base &&rhs) noexcept {
2624 if (!this->m_has_val && rhs.m_has_val) {
2626 construct(std::move(rhs).get());
2628 assign_common(std::move(rhs));
2636 void assign_common(Rhs &&rhs) {
2638 if (rhs.m_has_val) {
2639 get() = std::forward<Rhs>(rhs).get();
2642 construct_error(std::forward<Rhs>(rhs).geterr());
2645 if (!rhs.m_has_val) {
2646 geterr() = std::forward<Rhs>(rhs).geterr();
2702 void assign(Rhs &&rhs) noexcept {
2704 if (rhs.m_has_val) {
2708 geterr() = std::forward<Rhs>(rhs).geterr();
2711 if (!rhs.m_has_val) {
2712 construct_error(std::forward<Rhs>(rhs).geterr());
2752 expected_copy_base(const expected_copy_base &rhs)
2754 if (rhs.has_value()) {
2755 this->construct_with(rhs);
2757 this->construct_error(rhs.geterr());
2761 expected_copy_base(expected_copy_base &&rhs) = default;
2762 expected_copy_base &operator=(const expected_copy_base &rhs) = default;
2763 expected_copy_base &operator=(expected_copy_base &&rhs) = default;
2787 expected_move_base(const expected_move_base &rhs) = default;
2789 expected_move_base(expected_move_base &&rhs) noexcept(
2792 if (rhs.has_value()) {
2793 this->construct_with(std::move(rhs));
2795 this->construct_error(std::move(rhs.geterr()));
2798 expected_move_base &operator=(const expected_move_base &rhs) = default;
2799 expected_move_base &operator=(expected_move_base &&rhs) = default;
2820 expected_copy_assign_base(const expected_copy_assign_base &rhs) = default;
2822 expected_copy_assign_base(expected_copy_assign_base &&rhs) = default;
2823 expected_copy_assign_base &operator=(const expected_copy_assign_base &rhs) {
2824 this->assign(rhs);
2827 expected_copy_assign_base &operator=(expected_copy_assign_base &&rhs) =
2859 expected_move_assign_base(const expected_move_assign_base &rhs) = default;
2861 expected_move_assign_base(expected_move_assign_base &&rhs) = default;
2863 expected_move_assign_base &operator=(const expected_move_assign_base &rhs) =
2867 operator=(expected_move_assign_base &&rhs) noexcept(
2870 this->assign(std::move(rhs));
3356 constexpr expected(const expected &rhs) = default;
3357 constexpr expected(expected &&rhs) = default;
3358 expected &operator=(const expected &rhs) = default;
3359 expected &operator=(expected &&rhs) = default;
3432 explicit TL_EXPECTED_11_CONSTEXPR expected(const expected<U, G> &rhs)
3434 if (rhs.has_value()) {
3435 this->construct(*rhs);
3437 this->construct_error(rhs.error());
3447 TL_EXPECTED_11_CONSTEXPR expected(const expected<U, G> &rhs)
3449 if (rhs.has_value()) {
3450 this->construct(*rhs);
3452 this->construct_error(rhs.error());
3461 explicit TL_EXPECTED_11_CONSTEXPR expected(expected<U, G> &&rhs)
3463 if (rhs.has_value()) {
3464 this->construct(std::move(*rhs));
3466 this->construct_error(std::move(rhs.error()));
3475 TL_EXPECTED_11_CONSTEXPR expected(expected<U, G> &&rhs)
3477 if (rhs.has_value()) {
3478 this->construct(std::move(*rhs));
3480 this->construct_error(std::move(rhs.error()));
3561 expected &operator=(const unexpected<G> &rhs) {
3563 err() = rhs;
3566 ::new (errptr()) unexpected<E>(rhs);
3576 expected &operator=(unexpected<G> &&rhs) noexcept {
3578 err() = std::move(rhs);
3581 ::new (errptr()) unexpected<E>(std::move(rhs));
3673 void swap_where_both_have_value(expected & /*rhs*/, t_is_void) noexcept {
3677 void swap_where_both_have_value(expected &rhs, t_is_not_void) {
3679 swap(val(), rhs.val());
3682 void swap_where_only_one_has_value(expected &rhs, t_is_void) noexcept(
3684 ::new (errptr()) unexpected_type(std::move(rhs.err()));
3685 rhs.err().~unexpected_type();
3686 std::swap(this->m_has_val, rhs.m_has_val);
3689 void swap_where_only_one_has_value(expected &rhs, t_is_not_void) {
3691 rhs, typename std::is_nothrow_move_constructible<T>::type{},
3696 expected &rhs, t_is_nothrow_move_constructible,
3700 ::new (errptr()) unexpected_type(std::move(rhs.err()));
3701 rhs.err().~unexpected_type();
3702 ::new (rhs.valptr()) T(std::move(temp));
3703 std::swap(this->m_has_val, rhs.m_has_val);
3707 expected &rhs, t_is_nothrow_move_constructible,
3713 ::new (errptr()) unexpected_type(std::move(rhs.err()));
3714 rhs.err().~unexpected_type();
3715 ::new (rhs.valptr()) T(std::move(temp));
3716 std::swap(this->m_has_val, rhs.m_has_val);
3722 ::new (errptr()) unexpected_type(std::move(rhs.err()));
3723 rhs.err().~unexpected_type();
3724 ::new (rhs.valptr()) T(std::move(temp));
3725 std::swap(this->m_has_val, rhs.m_has_val);
3730 expected &rhs, move_constructing_t_can_throw,
3732 auto temp = std::move(rhs.err());
3733 rhs.err().~unexpected_type();
3736 ::new (rhs.valptr()) T(std::move(val()));
3739 std::swap(this->m_has_val, rhs.m_has_val);
3741 rhs.err() = std::move(temp);
3745 ::new (rhs.valptr()) T(std::move(val()));
3748 std::swap(this->m_has_val, rhs.m_has_val);
3758 swap(expected &rhs) noexcept(
3763 if (has_value() && rhs.has_value()) {
3764 swap_where_both_have_value(rhs, typename std::is_void<T>::type{});
3765 } else if (!has_value() && rhs.has_value()) {
3766 rhs.swap(*this);
3768 swap_where_only_one_has_value(rhs, typename std::is_void<T>::type{});
3771 swap(err(), rhs.err());
4205 const expected<U, F> &rhs) {
4206 return (lhs.has_value() != rhs.has_value())
4208 : (!lhs.has_value() ? lhs.error() == rhs.error() : *lhs == *rhs);
4212 const expected<U, F> &rhs) {
4213 return (lhs.has_value() != rhs.has_value())
4215 : (!lhs.has_value() ? lhs.error() != rhs.error() : *lhs != *rhs);
4219 const expected<void, F> &rhs) {
4220 return (lhs.has_value() != rhs.has_value())
4222 : (!lhs.has_value() ? lhs.error() == rhs.error() : true);
4226 const expected<void, F> &rhs) {
4227 return (lhs.has_value() != rhs.has_value())
4229 : (!lhs.has_value() ? lhs.error() == rhs.error() : false);
4273 expected<T, E> &rhs) noexcept(noexcept(lhs.swap(rhs))) {
4274 lhs.swap(rhs);
7022 [](const key_value_pair &lhs, const key_value_pair &rhs) {
7023 return lhs.first < rhs.first;