From bf11ee6662c42e045dcfd3152758e1166a09fc3c Mon Sep 17 00:00:00 2001 From: Wu Yongwei Date: Sat, 13 Jan 2018 16:12:55 +0800 Subject: [PATCH] Fix expected and unexpected comparison p0323 currently contains a copy/paste error. --- tl/expected.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tl/expected.hpp b/tl/expected.hpp index da0fd55..4f95a0f 100644 --- a/tl/expected.hpp +++ b/tl/expected.hpp @@ -1985,19 +1985,19 @@ constexpr bool operator!=(const U &v, const expected &x) { template constexpr bool operator==(const expected &x, const unexpected &e) { - return x.has_value() ? true : x.error() == e.value(); + return x.has_value() ? false : x.error() == e.value(); } template constexpr bool operator==(const unexpected &e, const expected &x) { - return x.has_value() ? true : x.error() == e.value(); + return x.has_value() ? false : x.error() == e.value(); } template constexpr bool operator!=(const expected &x, const unexpected &e) { - return x.has_value() ? false : x.error() != e.value(); + return x.has_value() ? true : x.error() != e.value(); } template constexpr bool operator!=(const unexpected &e, const expected &x) { - return x.has_value() ? false : x.error() != e.value(); + return x.has_value() ? true : x.error() != e.value(); } // TODO is_swappable