31,32c31
< #include <ctype.h>
<
---
> #include <cctype>
34a34
> #include <limits>
120,125c120,124
< static const bool sign = maxnum < 0;
< static const int bits = sizeof(T) * 8;
< static const T hexmax = maxnum & (((T)1 << (bits - 4 - sign)) - 1);
< static const T octmax = maxnum & (((T)1 << (bits - 3 - sign)) - 1);
< static const T signmax =
< (sign) ? maxnum & (((T)1 << (bits - 1)) - 1) : maxnum;
---
> static const bool sign = numeric_limits<T>::is_signed;
> static const int bits = numeric_limits<T>::digits;
> static const T hexmax = maxnum & (((T)1 << (bits - 4)) - 1);
> static const T octmax = maxnum & (((T)1 << (bits - 3)) - 1);
> static const T signmax = numeric_limits<T>::max();