From 3ae40129b7081b21d3a1a14f7abe51758f70d87a Mon Sep 17 00:00:00 2001 From: Simon Brand Date: Mon, 2 Oct 2017 10:05:36 +0100 Subject: [PATCH] Fix relops --- optional.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/optional.hpp b/optional.hpp index f134227..8a125f5 100644 --- a/optional.hpp +++ b/optional.hpp @@ -293,7 +293,7 @@ inline constexpr bool operator==(const U &lhs, const optional &rhs) { } template inline constexpr bool operator!=(const optional &lhs, const U &rhs) { - return lhs.has_value() ? *lhs != lhs : true; + return lhs.has_value() ? *lhs != rhs : true; } template inline constexpr bool operator!=(const U &lhs, const optional &rhs) { @@ -301,7 +301,7 @@ inline constexpr bool operator!=(const U &lhs, const optional &rhs) { } template inline constexpr bool operator<(const optional &lhs, const U &rhs) { - return lhs.has_value() ? *lhs < lhs : true; + return lhs.has_value() ? *lhs < rhs : true; } template inline constexpr bool operator<(const U &lhs, const optional &rhs) { @@ -309,7 +309,7 @@ inline constexpr bool operator<(const U &lhs, const optional &rhs) { } template inline constexpr bool operator<=(const optional &lhs, const U &rhs) { - return lhs.has_value() ? *lhs <= lhs : true; + return lhs.has_value() ? *lhs <= rhs : true; } template inline constexpr bool operator<=(const U &lhs, const optional &rhs) { @@ -317,7 +317,7 @@ inline constexpr bool operator<=(const U &lhs, const optional &rhs) { } template inline constexpr bool operator>(const optional &lhs, const U &rhs) { - return lhs.has_value() ? *lhs > lhs : false; + return lhs.has_value() ? *lhs > rhs : false; } template inline constexpr bool operator>(const U &lhs, const optional &rhs) { @@ -325,7 +325,7 @@ inline constexpr bool operator>(const U &lhs, const optional &rhs) { } template inline constexpr bool operator>=(const optional &lhs, const U &rhs) { - return lhs.has_value() ? *lhs >= lhs : false; + return lhs.has_value() ? *lhs >= rhs : false; } template inline constexpr bool operator>=(const U &lhs, const optional &rhs) {