forked from boostorg/integer
Write out limits as integers, even for char types.
[SVN r11301]
This commit is contained in:
@ -35,14 +35,19 @@
|
|||||||
* Therefore, avoid explicit function template instantiations.
|
* Therefore, avoid explicit function template instantiations.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
template<typename T> 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<class T>
|
template<class T>
|
||||||
void runtest(const char * type, T)
|
void runtest(const char * type, T)
|
||||||
{
|
{
|
||||||
typedef boost::integer_traits<T> traits;
|
typedef boost::integer_traits<T> traits;
|
||||||
std::cout << "Checking " << type
|
std::cout << "Checking " << type
|
||||||
<< "; min is " << traits::min()
|
<< "; min is " << make_char_numeric_for_streaming(traits::min())
|
||||||
<< ", max is " << traits::max()
|
<< ", max is " << make_char_numeric_for_streaming(traits::max())
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
BOOST_TEST(traits::is_specialized);
|
BOOST_TEST(traits::is_specialized);
|
||||||
BOOST_TEST(traits::is_integer);
|
BOOST_TEST(traits::is_integer);
|
||||||
BOOST_TEST(traits::is_integral);
|
BOOST_TEST(traits::is_integral);
|
||||||
|
Reference in New Issue
Block a user