std::numeric_limits::is_signed

std::numeric_limits::is_signed

static const bool is_signed;
(until C++11)
static constexpr bool is_signed;
(since C++11)

The value of std::numeric_limits<T>::is_signed is true for all signed arithmetic types T and false for the unsigned types. This constant is meaningful for all specializations.

Standard specializations

T value of std::numeric_limits<T>::is_signed
/* 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

See also

(C++11)
checks if a type is signed integer type
(class template)
[static]
identifies integer types
(public static member constant)
[static]
identifies exact types
(public static member constant)
[static]
identifies types that represent a finite set of values
(public static member constant)

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
http://en.cppreference.com/w/cpp/types/numeric_limits/is_signed

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部