std::numeric_limits<T>::is_signed

 
 
 
Type support
Basic types
Fundamental types
Fixed width integer types (C++11)
Numeric limits
C numeric limits interface
Runtime type information
Type traits
Type categories
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
Type properties
(C++11)
(C++11)
(C++14)
(C++11)
(C++11)(until C++20)
(C++11)(deprecated in C++20)
(C++11)
Type trait constants
Metafunctions
(C++17)
Endian
(C++20)
Constant evaluation context
Supported operations
Relationships and property queries
(C++11)
(C++11)
Type modifications
(C++11)(C++11)(C++11)
Type transformations
(C++11)
(C++11)
(C++17)
(C++11)(until C++20)(C++17)
 
 
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
char8_t false
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 a signed arithmetic 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)