Add a way to change fallback stringifier

This allows reuse of projects existing stringification machinery

Closes #1024
This commit is contained in:
Martin Hořeňovský
2018-02-11 16:31:12 +01:00
parent 082c3b84bc
commit 34d7a33574
2 changed files with 18 additions and 0 deletions

View File

@@ -88,7 +88,11 @@ namespace Catch {
static
typename std::enable_if<!::Catch::Detail::IsStreamInsertable<Fake>::value, std::string>::type
convert( const Fake& value ) {
#if !defined(CATCH_CONFIG_FALLBACK_STRINGIFIER)
return Detail::convertUnstreamable( value );
#else
return CATCH_CONFIG_FALLBACK_STRINGIFIER( value );
#endif
}
};