std::numeric_limits::is_signed
STD::数字[医]限制::IS[医]签名
static const bool is_signed; | | (until C++11) |
---|---|---|
static constexpr bool is_signed; | | (since C++11) |
价值std::numeric_limits<T>::is_signed是true对于所有有符号的算术类型T和false用于无符号类型。这个常量对于所有的专门化都是有意义的。
标准专业化
T | value of std::numeric_limits |
---|---|
/* non-specialized */ | false |
bool | false |
char | implementation-defined |
signed char | true |
unsigned char | false |
wchar_t | implementation-defined |
char16_t | false |
char32_t | false |
short | true |
unsigned short | false |
int | true |
unsigned int | false |
long | true |
unsigned long | false |
long long | true |
unsigned long long | false |
float | true |
double | true |
long double | true |
另见
is_signed (C++11) | checks if a type is signed integer type (class template) |
---|---|
is_integer static | identifies integer types (public static member constant) |
is_exact static | identifies exact types (public static member constant) |
is_bounded static | identifies types that represent a finite set of values (public static member constant) |
© cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。