B
baibaichen
hi,
consider the follow code:
#ifdef USE_UNSIGNED_INT
typedef unsigned int size;
#else
typedef unsigned int size;
#endif
latter in the program:
size i = XXX;
for (; i >0 ; i++) //problematic, if the i is the unsigned it!!!
{
}
is there any static assert way to distinguish whether the type is
unsigned or not? such as :
size i = XXX;
STATIC_ASSERT_IS_NOT_SIGNED(size);
for (; i >0 ; i++) {
}
thanks
consider the follow code:
#ifdef USE_UNSIGNED_INT
typedef unsigned int size;
#else
typedef unsigned int size;
#endif
latter in the program:
size i = XXX;
for (; i >0 ; i++) //problematic, if the i is the unsigned it!!!
{
}
is there any static assert way to distinguish whether the type is
unsigned or not? such as :
size i = XXX;
STATIC_ASSERT_IS_NOT_SIGNED(size);
for (; i >0 ; i++) {
}
thanks