mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 12:17:11 +01:00 
			
		
		
		
	Add additional static_assert for the REQUIRE(a == b && c == d) case
This commit is contained in:
		 hbina4326
					hbina4326
				
			
				
					committed by
					
						 Martin Hořeňovský
						Martin Hořeňovský
					
				
			
			
				
	
			
			
			 Martin Hořeňovský
						Martin Hořeňovský
					
				
			
						parent
						
							b3faceede2
						
					
				
				
					commit
					d54c2258e0
				
			| @@ -63,6 +63,62 @@ namespace Catch { | |||||||
|             m_op( op ), |             m_op( op ), | ||||||
|             m_rhs( rhs ) |             m_rhs( rhs ) | ||||||
|         {} |         {} | ||||||
|  |  | ||||||
|  |         template<typename T> | ||||||
|  |         auto operator && ( T ) const -> BinaryExpr<LhsT, RhsT const&> const { | ||||||
|  |             static_assert(always_false<T>::value, | ||||||
|  |             "operator|| is not supported inside assertions, " | ||||||
|  |             "wrap the expression inside parentheses, or decompose it"); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         template<typename T> | ||||||
|  |         auto operator || ( T ) const -> BinaryExpr<LhsT, RhsT const&> const { | ||||||
|  |             static_assert(always_false<T>::value, | ||||||
|  |             "operator|| is not supported inside assertions, " | ||||||
|  |             "wrap the expression inside parentheses, or decompose it"); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         template<typename T> | ||||||
|  |         auto operator == ( T ) const -> BinaryExpr<LhsT, RhsT const&> const { | ||||||
|  |             static_assert(always_false<T>::value, | ||||||
|  |             "operator|| is not supported inside assertions, " | ||||||
|  |             "wrap the expression inside parentheses, or decompose it"); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         template<typename T> | ||||||
|  |         auto operator != ( T ) const -> BinaryExpr<LhsT, RhsT const&> const { | ||||||
|  |             static_assert(always_false<T>::value, | ||||||
|  |             "operator|| is not supported inside assertions, " | ||||||
|  |             "wrap the expression inside parentheses, or decompose it"); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         template<typename T> | ||||||
|  |         auto operator > ( T ) const -> BinaryExpr<LhsT, RhsT const&> const { | ||||||
|  |             static_assert(always_false<T>::value, | ||||||
|  |             "operator|| is not supported inside assertions, " | ||||||
|  |             "wrap the expression inside parentheses, or decompose it"); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         template<typename T> | ||||||
|  |         auto operator < ( T ) const -> BinaryExpr<LhsT, RhsT const&> const { | ||||||
|  |             static_assert(always_false<T>::value, | ||||||
|  |             "operator|| is not supported inside assertions, " | ||||||
|  |             "wrap the expression inside parentheses, or decompose it"); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         template<typename T> | ||||||
|  |         auto operator >= ( T ) const -> BinaryExpr<LhsT, RhsT const&> const { | ||||||
|  |             static_assert(always_false<T>::value, | ||||||
|  |             "operator|| is not supported inside assertions, " | ||||||
|  |             "wrap the expression inside parentheses, or decompose it"); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         template<typename T> | ||||||
|  |         auto operator <= ( T ) const -> BinaryExpr<LhsT, RhsT const&> const { | ||||||
|  |             static_assert(always_false<T>::value, | ||||||
|  |             "operator|| is not supported inside assertions, " | ||||||
|  |             "wrap the expression inside parentheses, or decompose it"); | ||||||
|  |         } | ||||||
|     }; |     }; | ||||||
|  |  | ||||||
|     template<typename LhsT> |     template<typename LhsT> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user