From 85d2d0daabe3884f2b755a92bf3c3479607dd61f Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Wed, 3 Nov 2021 02:02:18 +0000 Subject: [PATCH] Fix 3rd party optional comparison operators --- src/3rdparty/optional/optional.hpp | 147 +++-------------------------- 1 file changed, 12 insertions(+), 135 deletions(-) diff --git a/src/3rdparty/optional/optional.hpp b/src/3rdparty/optional/optional.hpp index e22297c4c6..e0bf7007e8 100644 --- a/src/3rdparty/optional/optional.hpp +++ b/src/3rdparty/optional/optional.hpp @@ -826,185 +826,62 @@ template constexpr bool operator>=(nullopt_t, const optional& x) no // 20.5.10, Comparison with T -template constexpr bool operator==(const optional& x, const T& v) +template constexpr bool operator==(const optional& x, const U& v) { return bool(x) ? *x == v : false; } -template constexpr bool operator==(const T& v, const optional& x) +template constexpr bool operator==(const T& v, const optional& x) { return bool(x) ? v == *x : false; } -template constexpr bool operator!=(const optional& x, const T& v) +template constexpr bool operator!=(const optional& x, const U& v) { return bool(x) ? *x != v : true; } -template constexpr bool operator!=(const T& v, const optional& x) +template constexpr bool operator!=(const T& v, const optional& x) { return bool(x) ? v != *x : true; } -template constexpr bool operator<(const optional& x, const T& v) +template constexpr bool operator<(const optional& x, const U& v) { return bool(x) ? *x < v : true; } -template constexpr bool operator>(const T& v, const optional& x) +template constexpr bool operator>(const T& v, const optional& x) { return bool(x) ? v > *x : true; } -template constexpr bool operator>(const optional& x, const T& v) +template constexpr bool operator>(const optional& x, const U& v) { return bool(x) ? *x > v : false; } -template constexpr bool operator<(const T& v, const optional& x) +template constexpr bool operator<(const T& v, const optional& x) { return bool(x) ? v < *x : false; } -template constexpr bool operator>=(const optional& x, const T& v) +template constexpr bool operator>=(const optional& x, const U& v) { return bool(x) ? *x >= v : false; } -template constexpr bool operator<=(const T& v, const optional& x) +template constexpr bool operator<=(const T& v, const optional& x) { return bool(x) ? v <= *x : false; } -template constexpr bool operator<=(const optional& x, const T& v) +template constexpr bool operator<=(const optional& x, const U& v) { return bool(x) ? *x <= v : true; } -template constexpr bool operator>=(const T& v, const optional& x) -{ - return bool(x) ? v >= *x : true; -} - - -// Comparison of optional with T -template constexpr bool operator==(const optional& x, const T& v) -{ - return bool(x) ? *x == v : false; -} - -template constexpr bool operator==(const T& v, const optional& x) -{ - return bool(x) ? v == *x : false; -} - -template constexpr bool operator!=(const optional& x, const T& v) -{ - return bool(x) ? *x != v : true; -} - -template constexpr bool operator!=(const T& v, const optional& x) -{ - return bool(x) ? v != *x : true; -} - -template constexpr bool operator<(const optional& x, const T& v) -{ - return bool(x) ? *x < v : true; -} - -template constexpr bool operator>(const T& v, const optional& x) -{ - return bool(x) ? v > *x : true; -} - -template constexpr bool operator>(const optional& x, const T& v) -{ - return bool(x) ? *x > v : false; -} - -template constexpr bool operator<(const T& v, const optional& x) -{ - return bool(x) ? v < *x : false; -} - -template constexpr bool operator>=(const optional& x, const T& v) -{ - return bool(x) ? *x >= v : false; -} - -template constexpr bool operator<=(const T& v, const optional& x) -{ - return bool(x) ? v <= *x : false; -} - -template constexpr bool operator<=(const optional& x, const T& v) -{ - return bool(x) ? *x <= v : true; -} - -template constexpr bool operator>=(const T& v, const optional& x) -{ - return bool(x) ? v >= *x : true; -} - -// Comparison of optional with T -template constexpr bool operator==(const optional& x, const T& v) -{ - return bool(x) ? *x == v : false; -} - -template constexpr bool operator==(const T& v, const optional& x) -{ - return bool(x) ? v == *x : false; -} - -template constexpr bool operator!=(const optional& x, const T& v) -{ - return bool(x) ? *x != v : true; -} - -template constexpr bool operator!=(const T& v, const optional& x) -{ - return bool(x) ? v != *x : true; -} - -template constexpr bool operator<(const optional& x, const T& v) -{ - return bool(x) ? *x < v : true; -} - -template constexpr bool operator>(const T& v, const optional& x) -{ - return bool(x) ? v > *x : true; -} - -template constexpr bool operator>(const optional& x, const T& v) -{ - return bool(x) ? *x > v : false; -} - -template constexpr bool operator<(const T& v, const optional& x) -{ - return bool(x) ? v < *x : false; -} - -template constexpr bool operator>=(const optional& x, const T& v) -{ - return bool(x) ? *x >= v : false; -} - -template constexpr bool operator<=(const T& v, const optional& x) -{ - return bool(x) ? v <= *x : false; -} - -template constexpr bool operator<=(const optional& x, const T& v) -{ - return bool(x) ? *x <= v : true; -} - -template constexpr bool operator>=(const T& v, const optional& x) +template constexpr bool operator>=(const T& v, const optional& x) { return bool(x) ? v >= *x : true; }