mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 20:27:11 +01:00 
			
		
		
		
	Move FALLBACK_STRINGIFIER to before the enum and range fallbacks
This should align more closely with the intended semantics, where types without `StringMaker` specialization or `operator<<` overload are passed down to the user defined fallback stringifier. Related to #1024
This commit is contained in:
		| @@ -64,13 +64,8 @@ namespace Catch { | |||||||
|         template<typename T> |         template<typename T> | ||||||
|         typename std::enable_if< |         typename std::enable_if< | ||||||
|             !std::is_enum<T>::value && !std::is_base_of<std::exception, T>::value, |             !std::is_enum<T>::value && !std::is_base_of<std::exception, T>::value, | ||||||
|         std::string>::type convertUnstreamable( T const& value ) { |         std::string>::type convertUnstreamable( T const& ) { | ||||||
| #if !defined(CATCH_CONFIG_FALLBACK_STRINGIFIER) |  | ||||||
|             (void)value; |  | ||||||
|             return Detail::unprintableString; |             return Detail::unprintableString; | ||||||
| #else |  | ||||||
|             return CATCH_CONFIG_FALLBACK_STRINGIFIER(value); |  | ||||||
| #endif |  | ||||||
|         } |         } | ||||||
|         template<typename T> |         template<typename T> | ||||||
|         typename std::enable_if< |         typename std::enable_if< | ||||||
| @@ -118,7 +113,11 @@ namespace Catch { | |||||||
|         static |         static | ||||||
|         typename std::enable_if<!::Catch::Detail::IsStreamInsertable<Fake>::value, std::string>::type |         typename std::enable_if<!::Catch::Detail::IsStreamInsertable<Fake>::value, std::string>::type | ||||||
|             convert( const Fake& value ) { |             convert( const Fake& value ) { | ||||||
|  | #if !defined(CATCH_CONFIG_FALLBACK_STRINGIFIER) | ||||||
|             return Detail::convertUnstreamable(value); |             return Detail::convertUnstreamable(value); | ||||||
|  | #else | ||||||
|  |             return CATCH_CONFIG_FALLBACK_STRINGIFIER(value); | ||||||
|  | #endif | ||||||
|         } |         } | ||||||
|     }; |     }; | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Martin Hořeňovský
					Martin Hořeňovský