mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Added specialization to log unsigned chars as integers
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@412 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
parent
f66e06f4fe
commit
47cf8b3e47
2 changed files with 9 additions and 0 deletions
|
|
@ -140,6 +140,10 @@ namespace detail2
|
||||||
{
|
{
|
||||||
s << '"' << str << '"';
|
s << '"' << str << '"';
|
||||||
}
|
}
|
||||||
|
inline void serialize( stream& s, unsigned char c )
|
||||||
|
{
|
||||||
|
s << static_cast< int >( c );
|
||||||
|
}
|
||||||
|
|
||||||
template< typename T >
|
template< typename T >
|
||||||
struct formatter
|
struct formatter
|
||||||
|
|
|
||||||
|
|
@ -558,3 +558,8 @@ BOOST_AUTO_TEST_CASE( mock_detail_template_template_streamable_yields_its_value_
|
||||||
{
|
{
|
||||||
BOOST_CHECK_EQUAL( "mock::detail::template_streamable", to_string( mock::detail::template_streamable< int >() ) );
|
BOOST_CHECK_EQUAL( "mock::detail::template_streamable", to_string( mock::detail::template_streamable< int >() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE( unsigned_char_is_serialized_as_int )
|
||||||
|
{
|
||||||
|
BOOST_CHECK_EQUAL( boost::lexical_cast< std::string >( int( 'a' ) ), to_string( unsigned char( 'a' ) ) );
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue