mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-25 23:06:10 +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:
parent
90988f578c
commit
4c7b7d04fe
@ -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 ) {
|
||||||
return Detail::convertUnstreamable( value );
|
#if !defined(CATCH_CONFIG_FALLBACK_STRINGIFIER)
|
||||||
|
return Detail::convertUnstreamable(value);
|
||||||
|
#else
|
||||||
|
return CATCH_CONFIG_FALLBACK_STRINGIFIER(value);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user