using namespace Msp;
-template<typename T>
-struct IsSigned
-{ enum { result = !(static_cast<T>(-1)>0) }; };
-
/* Helper to avoid warnings about an unsigned type never being < 0 */
-template<typename T, bool f = IsSigned<T>::result>
+template<typename T, bool f = is_signed<T>::value>
struct IsNegative
{ static bool eval(T v) { return v<0; } };
/* Helper to avoid errors about ambiguous function calls since there are no
overloads of abs for unsigned types */
-template<typename T, bool f = IsSigned<T>::result>
+template<typename T, bool f = is_signed<T>::value>
struct Absolute
{ static T eval(T v) { return v<0 ? -v : v; } };
bool neg = false;
if(*i=='-')
{
- if(!IsSigned<T>::result)
+ if(is_unsigned<T>::value)
throw lexical_error(format("conversion of '%s' to unsigned integer", s));
neg = true;
++i;