Added toString overload for chars

(and, by extension, Obj-C's BOOL)
This commit is contained in:
Phil Nash
2012-06-06 08:06:40 +01:00
parent e463687725
commit 78372d09d4
5 changed files with 37 additions and 1 deletions

View File

@@ -115,6 +115,16 @@ inline std::string toString( bool value ) {
return value ? "true" : "false";
}
inline std::string toString( char value ) {
return value < ' '
? toString( (unsigned int)value )
: Detail::makeString( value );
}
inline std::string toString( signed char value ) {
return toString( static_cast<char>( value ) );
}
#ifdef CATCH_CONFIG_CPP11_NULLPTR
inline std::string toString( std::nullptr_t ) {
return "nullptr";