Commit fb4dcb81 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[FIX #196] unsigned chars are now interpreted as numbers.

parent f7064fde
......@@ -124,6 +124,21 @@ namespace string_utils
return ss.str();
}
/**
* Convert a given value to a string. The input value must provide a operator<< or be a standard scalar type.
*
* \param value the value to cast to string
*
* \return the string.
*/
inline std::string toString( const unsigned char& value ) // NOLINT: stylechecker complains about non const ref!?
{
std::stringstream ss;
// NOTE: unsigned chars are interpreted as ASCII chars. We want it to be used as number.
ss << static_cast< int >( value );
return ss.str();
}
/**
* Convert a given value to a string. The input value must provide a operator<< or be a standard scalar type. This method additionally allows
* setting width and precision flags of the used std::stringstream.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment