19
If what you want is a simple macro, this should do the trick:
#define is_type_signed(my_type) (((my_type)-1) < 0)
You could do this better with a template function, less macro nasty business.
template <typename T>
bool IsSignedType()
{
// A lot of assumptions on T here
T instanceAsOne = 1;
if (-instanceAsOne > 0)
{
return true;
}
else
{
return false;
}
}
Forgive the formatting...
I would try this out and see if it works...