Fix 3rd party optional comparison operators
This commit is contained in:
		
							
								
								
									
										147
									
								
								src/3rdparty/optional/optional.hpp
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										147
									
								
								src/3rdparty/optional/optional.hpp
									
									
									
									
										vendored
									
									
								
							| @@ -826,185 +826,62 @@ template <class T> constexpr bool operator>=(nullopt_t, const optional<T>& x) no | ||||
|  | ||||
|  | ||||
| // 20.5.10, Comparison with T | ||||
| template <class T> constexpr bool operator==(const optional<T>& x, const T& v) | ||||
| template <class T, class U> constexpr bool operator==(const optional<T>& x, const U& v) | ||||
| { | ||||
|   return bool(x) ? *x == v : false; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator==(const T& v, const optional<T>& x) | ||||
| template <class T, class U> constexpr bool operator==(const T& v, const optional<U>& x) | ||||
| { | ||||
|   return bool(x) ? v == *x : false; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator!=(const optional<T>& x, const T& v) | ||||
| template <class T, class U> constexpr bool operator!=(const optional<T>& x, const U& v) | ||||
| { | ||||
|   return bool(x) ? *x != v : true; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator!=(const T& v, const optional<T>& x) | ||||
| template <class T, class U> constexpr bool operator!=(const T& v, const optional<U>& x) | ||||
| { | ||||
|   return bool(x) ? v != *x : true; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator<(const optional<T>& x, const T& v) | ||||
| template <class T, class U> constexpr bool operator<(const optional<T>& x, const U& v) | ||||
| { | ||||
|   return bool(x) ? *x < v : true; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator>(const T& v, const optional<T>& x) | ||||
| template <class T, class U> constexpr bool operator>(const T& v, const optional<U>& x) | ||||
| { | ||||
|   return bool(x) ? v > *x : true; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator>(const optional<T>& x, const T& v) | ||||
| template <class T, class U> constexpr bool operator>(const optional<T>& x, const U& v) | ||||
| { | ||||
|   return bool(x) ? *x > v : false; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator<(const T& v, const optional<T>& x) | ||||
| template <class T, class U> constexpr bool operator<(const T& v, const optional<T>& x) | ||||
| { | ||||
|   return bool(x) ? v < *x : false; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator>=(const optional<T>& x, const T& v) | ||||
| template <class T, class U> constexpr bool operator>=(const optional<T>& x, const U& v) | ||||
| { | ||||
|   return bool(x) ? *x >= v : false; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator<=(const T& v, const optional<T>& x) | ||||
| template <class T, class U> constexpr bool operator<=(const T& v, const optional<U>& x) | ||||
| { | ||||
|   return bool(x) ? v <= *x : false; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator<=(const optional<T>& x, const T& v) | ||||
| template <class T, class U> constexpr bool operator<=(const optional<T>& x, const U& v) | ||||
| { | ||||
|   return bool(x) ? *x <= v : true; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator>=(const T& v, const optional<T>& x) | ||||
| { | ||||
|   return bool(x) ? v >= *x : true; | ||||
| } | ||||
|  | ||||
|  | ||||
| // Comparison of optional<T&> with T | ||||
| template <class T> constexpr bool operator==(const optional<T&>& x, const T& v) | ||||
| { | ||||
|   return bool(x) ? *x == v : false; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator==(const T& v, const optional<T&>& x) | ||||
| { | ||||
|   return bool(x) ? v == *x : false; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator!=(const optional<T&>& x, const T& v) | ||||
| { | ||||
|   return bool(x) ? *x != v : true; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator!=(const T& v, const optional<T&>& x) | ||||
| { | ||||
|   return bool(x) ? v != *x : true; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator<(const optional<T&>& x, const T& v) | ||||
| { | ||||
|   return bool(x) ? *x < v : true; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator>(const T& v, const optional<T&>& x) | ||||
| { | ||||
|   return bool(x) ? v > *x : true; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator>(const optional<T&>& x, const T& v) | ||||
| { | ||||
|   return bool(x) ? *x > v : false; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator<(const T& v, const optional<T&>& x) | ||||
| { | ||||
|   return bool(x) ? v < *x : false; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator>=(const optional<T&>& x, const T& v) | ||||
| { | ||||
|   return bool(x) ? *x >= v : false; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator<=(const T& v, const optional<T&>& x) | ||||
| { | ||||
|   return bool(x) ? v <= *x : false; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator<=(const optional<T&>& x, const T& v) | ||||
| { | ||||
|   return bool(x) ? *x <= v : true; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator>=(const T& v, const optional<T&>& x) | ||||
| { | ||||
|   return bool(x) ? v >= *x : true; | ||||
| } | ||||
|  | ||||
| // Comparison of optional<T const&> with T | ||||
| template <class T> constexpr bool operator==(const optional<const T&>& x, const T& v) | ||||
| { | ||||
|   return bool(x) ? *x == v : false; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator==(const T& v, const optional<const T&>& x) | ||||
| { | ||||
|   return bool(x) ? v == *x : false; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator!=(const optional<const T&>& x, const T& v) | ||||
| { | ||||
|   return bool(x) ? *x != v : true; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator!=(const T& v, const optional<const T&>& x) | ||||
| { | ||||
|   return bool(x) ? v != *x : true; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator<(const optional<const T&>& x, const T& v) | ||||
| { | ||||
|   return bool(x) ? *x < v : true; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator>(const T& v, const optional<const T&>& x) | ||||
| { | ||||
|   return bool(x) ? v > *x : true; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator>(const optional<const T&>& x, const T& v) | ||||
| { | ||||
|   return bool(x) ? *x > v : false; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator<(const T& v, const optional<const T&>& x) | ||||
| { | ||||
|   return bool(x) ? v < *x : false; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator>=(const optional<const T&>& x, const T& v) | ||||
| { | ||||
|   return bool(x) ? *x >= v : false; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator<=(const T& v, const optional<const T&>& x) | ||||
| { | ||||
|   return bool(x) ? v <= *x : false; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator<=(const optional<const T&>& x, const T& v) | ||||
| { | ||||
|   return bool(x) ? *x <= v : true; | ||||
| } | ||||
|  | ||||
| template <class T> constexpr bool operator>=(const T& v, const optional<const T&>& x) | ||||
| template <class T, class U> constexpr bool operator>=(const T& v, const optional<U>& x) | ||||
| { | ||||
|   return bool(x) ? v >= *x : true; | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Jonathan G Rennison
					Jonathan G Rennison