From 4d2a921dbf5d68978bdc5af0c65be710c8339e5e Mon Sep 17 00:00:00 2001 From: Darin Adler Date: Fri, 28 Sep 2001 17:38:10 +0000 Subject: [PATCH] Write out limits as integers, even for char types. [SVN r11301] --- integer_traits_test.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/integer_traits_test.cpp b/integer_traits_test.cpp index 84ad002..ea8adaf 100644 --- a/integer_traits_test.cpp +++ b/integer_traits_test.cpp @@ -35,14 +35,19 @@ * Therefore, avoid explicit function template instantiations. */ +template inline T make_char_numeric_for_streaming(T x) { return x; } +inline int make_char_numeric_for_streaming(char c) { return c; } +inline int make_char_numeric_for_streaming(signed char c) { return c; } +inline int make_char_numeric_for_streaming(unsigned char c) { return c; } + template void runtest(const char * type, T) { typedef boost::integer_traits traits; std::cout << "Checking " << type - << "; min is " << traits::min() - << ", max is " << traits::max() - << std::endl; + << "; min is " << make_char_numeric_for_streaming(traits::min()) + << ", max is " << make_char_numeric_for_streaming(traits::max()) + << std::endl; BOOST_TEST(traits::is_specialized); BOOST_TEST(traits::is_integer); BOOST_TEST(traits::is_integral);