mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 12:17:11 +01:00 
			
		
		
		
	Fix REQUIRE with const char strings
This commit is contained in:
		| @@ -39,11 +39,20 @@ namespace Catch { | |||||||
|         virtual std::string toString() = 0; |         virtual std::string toString() = 0; | ||||||
|     }; |     }; | ||||||
|  |  | ||||||
|  |     template <typename T> | ||||||
|  |     struct Decay { typedef T type; }; | ||||||
|  |  | ||||||
|  |     template <typename T> | ||||||
|  |     struct Decay<T[]> { typedef T* type; }; | ||||||
|  |  | ||||||
|  |     template <typename T, size_t N> | ||||||
|  |     struct Decay<T[N]> { typedef T* type; }; | ||||||
|  |  | ||||||
|     template <typename T> |     template <typename T> | ||||||
|     struct AnyTypeHolder : AnyTypeHolderBase { |     struct AnyTypeHolder : AnyTypeHolderBase { | ||||||
|         AnyTypeHolder( const T& value ) : value ( value ) {} |         AnyTypeHolder( const T& value ) : value ( value ) {} | ||||||
|         std::string toString() { return Catch::toString( value ); } |         std::string toString() { return Catch::toString( value ); } | ||||||
|         T value; |         const typename Decay<const T>::type value; | ||||||
|     }; |     }; | ||||||
|  |  | ||||||
|     class ResultBuilder { |     class ResultBuilder { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Ryan Gonzalez
					Ryan Gonzalez