mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 21:36:11 +01:00
Move fallback conversion after enum-check
This commit is contained in:
parent
c0267e5c20
commit
da783abee9
@ -61,8 +61,13 @@ namespace Catch {
|
|||||||
std::string convertUnknownEnumToString( E e );
|
std::string convertUnknownEnumToString( E e );
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
typename std::enable_if<!std::is_enum<T>::value, std::string>::type convertUnstreamable( T const& ) {
|
typename std::enable_if<!std::is_enum<T>::value, std::string>::type convertUnstreamable( T const& value ) {
|
||||||
|
#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<std::is_enum<T>::value, std::string>::type convertUnstreamable( T const& value ) {
|
typename std::enable_if<std::is_enum<T>::value, std::string>::type convertUnstreamable( T const& value ) {
|
||||||
@ -88,11 +93,7 @@ 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
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user