Namespaces
Variants
Views
Actions

Fixed width integer types (since C++11)

From cppreference.com
 
 
 
Type support
Basic types
Fundamental types
Fixed width integer types (C++11)
Numeric limits
numeric_limits
C numeric limits interface
Runtime type information
Type traits
Primary type categories
is_void(C++11)
is_array(C++11)
is_pointer(C++11)
is_enum(C++11)
is_union(C++11)
is_class(C++11)
is_function(C++11)
is_object(C++11)
is_scalar(C++11)
is_compound(C++11)
is_integral(C++11)
is_floating_point(C++11)
is_fundamental(C++11)
is_arithmetic(C++11)
is_reference(C++11)
is_lvalue_reference(C++11)
is_rvalue_reference(C++11)
is_member_pointer(C++11)
is_member_object_pointer(C++11)
is_member_function_pointer(C++11)
Type properties
is_const(C++11)
is_volatile(C++11)
is_pod(C++11)
is_empty(C++11)
is_polymorphic(C++11)
is_abstract(C++11)
Supported operations
is_constructible
is_trivially_constructible
is_nothrow_constructible
(C++11)
(C++11)
(C++11)
is_default_constructible
is_trivially_default_constructible
is_nothrow_default_constructible
(C++11)
(C++11)
(C++11)
is_copy_constructible
is_trivially_copy_constructible
is_nothrow_copy_constructible
(C++11)
(C++11)
(C++11)
is_move_constructible
is_trivially_move_constructible
is_nothrow_move_constructible
(C++11)
(C++11)
(C++11)
is_assignable
is_trivially_assignable
is_nothrow_assignable
(C++11)
(C++11)
(C++11)
is_copy_assignable
is_trivially_copy_assignable
is_nothrow_copy_assignable
(C++11)
(C++11)
(C++11)
is_move_assignable
is_trivially_move_assignable
is_nothrow_move_assignable
(C++11)
(C++11)
(C++11)
is_destructible
is_trivially_destructible
is_nothrow_destructible
(C++11)
(C++11)
(C++11)
has_virtual_destructor(C++11)
Relationships and property queries
is_same(C++11)
is_base_of(C++11)
is_convertible(C++11)
alignment_of(C++11)
rank(C++11)
extent(C++11)
Type modifications
remove_cv
remove_const
remove_volatile
(C++11)
(C++11)
(C++11)
add_cv
add_const
add_volatile
(C++11)
(C++11)
(C++11)
make_signed(C++11)
make_unsigned(C++11)
Type transformations
aligned_storage(C++11)
aligned_union(C++11)
decay(C++11)
enable_if(C++11)
conditional(C++11)
common_type(C++11)
underlying_type(C++11)
result_of(C++11)
Type trait constants
integral_constant(C++11)
 

Contents

[edit] Types

Defined in header <cstdint>
int8_t
int16_t
int32_t
int64_t
signed integer type with width of
exactly 8, 16, 32 and 64 bits respectively
with no padding bits and using 2's complement for negative values
(provided only if the implementation directly supports the type)
int_fast8_t
int_fast16_t
int_fast32_t
int_fast64_t
fastest signed signed integer type with width of
at least 8, 16, 32 and 64 bits respectively
int_least8_t
int_least16_t
int_least32_t
int_least64_t
smallest signed integer type with width of
at least 8, 16, 32 and 64 bits respectively
intmax_t maximum width integer type
intptr_t integer type capable of holding a pointer
uint8_t
uint16_t
uint32_t
uint64_t
unsigned integer type with width of
exactly 8, 16, 32 and 64 bits respectively
(provided only if the implementation directly supports the type)
uint_fast8_t
uint_fast16_t
uint_fast32_t
uint_fast64_t
fastest unsigned unsigned integer type with width of
at least 8, 16, 32 and 64 bits respectively
uint_least8_t
uint_least16_t
uint_least32_t
uint_least64_t
smallest unsigned integer type with width of
at least 8, 16, 32 and 64 bits respectively
uintmax_t maximum width unsigned integer type
uintptr_t unsigned integer type capable of holding a pointer

[edit] Macro constants

Defined in header <cstdint>
Signed integers : minimum value
INT8_MIN
INT16_MIN
INT32_MIN
INT64_MIN
minimum value of an object of type int8_t, int16_t, int32_t, int64_t
(macro constant)
INT_FAST8_MIN
INT_FAST16_MIN
INT_FAST32_MIN
INT_FAST64_MIN
minimum value of an object of type int_fast8_t, int_fast16_t, int_fast32_t, int_fast64_t
(macro constant)
INT_LEAST8_MIN
INT_LEAST16_MIN
INT_LEAST32_MIN
INT_LEAST64_MIN
minimum value of an object of type int_least8_t, int_least16_t, int_least32_t, int_least64_t
(macro constant)
INTPTR_MIN
minimum value of an object of type intptr_t
(macro constant)
INTMAX_MIN
minimum value of an object of type intmax_t
(macro constant)
Signed integers : maximum value
INT8_MAX
INT16_MAX
INT32_MAX
INT64_MAX
maximum value of an object of type int8_t, int16_t, int32_t, int64_t
(macro constant)
INT_FAST8_MAX
INT_FAST16_MAX
INT_FAST32_MAX
INT_FAST64_MAX
maximum value of an object of type int_fast8_t, int_fast16_t, int_fast32_t, int_fast64_t
(macro constant)
INT_LEAST8_MAX
INT_LEAST16_MAX
INT_LEAST32_MAX
INT_LEAST64_MAX
maximum value of an object of type int_least8_t, int_least16_t, int_least32_t, int_least64_t
(macro constant)
INTPTR_MAX
maximum value of an object of type intptr_t
(macro constant)
INTMAX_MAX
maximum value of an object of type intmax_t
(macro constant)
Unsigned integers : maximum value
UINT8_MAX
UINT16_MAX
UINT32_MAX
UINT64_MAX
maximum value of an object of type uint8_t, uint16_t, uint32_t, uint64_t
(macro constant)
UINT_FAST8_MAX
UINT_FAST16_MAX
UINT_FAST32_MAX
UINT_FAST64_MAX
maximum value of an object of type uint_fast8_t, uint_fast16_t, uint_fast32_t, uint_fast64_t
(macro constant)
UINT_LEAST8_MAX
UINT_LEAST16_MAX
UINT_LEAST32_MAX
UINT_LEAST64_MAX
maximum value of an object of type uint_least8_t, uint_least16_t, uint_least32_t, uint_least64_t
(macro constant)
UINTPTR_MAX
maximum value of an object of type uintptr_t
(macro constant)
UINTMAX_MAX
maximum value of an object of type uintmax_t
(macro constant)

[edit] Format macro constants

Defined in header <cinttypes>
Format constants for the std::fprintf family of functions
PRId8
PRId16
PRId32
PRId64
PRIdLEAST8
PRIdLEAST16
PRIdLEAST32
PRIdLEAST64
PRIdFAST8
PRIdFAST16
PRIdFAST32
PRIdFAST64
PRIdMAX
PRIdPTR
format conversion specifier to output a signed decimal integer value of type std::int8_t, std::int16_t, std::int32_t, std::int64_t, std::int_least8_t, std::int_least16_t, std::int_least32_t, std::int_least64_t, std::int_fast8_t, std::int_fast16_t, std::int_fast32_t, std::int_fast64_t, std:intmax_t, std::intptr_t respectively, equivalent to %d for int
(macro constant)
PRIi8
PRIi16
PRIi32
PRIi64
PRIiLEAST8
PRIiLEAST16
PRIiLEAST32
PRIiLEAST64
PRIiFAST8
PRIiFAST16
PRIiFAST32
PRIiFAST64
PRIiMAX
PRIiPTR
format conversion specifier to output a signed decimal integer value of type std::int8_t, std::int16_t, std::int32_t, std::int64_t, std::int_least8_t, std::int_least16_t, std::int_least32_t, std::int_least64_t, std::int_fast8_t, std::int_fast16_t, std::int_fast32_t, std::int_fast64_t, std:intmax_t, std::intptr_t respectively, equivalent to %i for int
(macro constant)
PRIu8
PRIu16
PRIu32
PRIu64
PRIuLEAST8
PRIuLEAST16
PRIuLEAST32
PRIuLEAST64
PRIuFAST8
PRIuFAST16
PRIuFAST32
PRIuFAST64
PRIuMAX
PRIuPTR
format conversion specifier to output an unsigned decimal integer value of type std::uint8_t, std::uint16_t, std::uint32_t, std::uint64_t, std::uint_least8_t, std::uint_least16_t, std::uint_least32_t, std::uint_least64_t, std::uint_fast8_t, std::uint_fast16_t, std::uint_fast32_t, std::uint_fast64_t, std:uintmax_t, std::uintptr_t respectively, equivalent to %u for unsigned int
(macro constant)
PRIo8
PRIo16
PRIo32
PRIo64
PRIoLEAST8
PRIoLEAST16
PRIoLEAST32
PRIoLEAST64
PRIoFAST8
PRIoFAST16
PRIoFAST32
PRIoFAST64
PRIoMAX
PRIoPTR
format conversion specifier to output an unsigned octal integer value of type std::uint8_t, std::uint16_t, std::uint32_t, std::uint64_t, std::uint_least8_t, std::uint_least16_t, std::uint_least32_t, std::uint_least64_t, std::uint_fast8_t, std::uint_fast16_t, std::uint_fast32_t, std::uint_fast64_t, std:uintmax_t, std::uintptr_t respectively, equivalent to %o for unsigned int
(macro constant)
PRIx8
PRIx16
PRIx32
PRIx64
PRIxLEAST8
PRIxLEAST16
PRIxLEAST32
PRIxLEAST64
PRIxFAST8
PRIxFAST16
PRIxFAST32
PRIxFAST64
PRIxMAX
PRIxPTR
format conversion specifier to output an unsigned hexadecimal integer value of type std::uint8_t, std::uint16_t, std::uint32_t, std::uint64_t, std::uint_least8_t, std::uint_least16_t, std::uint_least32_t, std::uint_least64_t, std::uint_fast8_t, std::uint_fast16_t, std::uint_fast32_t, std::uint_fast64_t, std:uintmax_t, std::uintptr_t respectively, equivalent to %x for unsigned int
(macro constant)
PRIX8
PRIX16
PRIX32
PRIX64
PRIXLEAST8
PRIXLEAST16
PRIXLEAST32
PRIXLEAST64
PRIXFAST8
PRIXFAST16
PRIXFAST32
PRIXFAST64
PRIXMAX
PRIXPTR
format conversion specifier to output an unsigned uppercase hexadecimal integer value of type std::uint8_t, std::uint16_t, std::uint32_t, std::uint64_t, std::uint_least8_t, std::uint_least16_t, std::uint_least32_t, std::uint_least64_t, std::uint_fast8_t, std::uint_fast16_t, std::uint_fast32_t, std::uint_fast64_t, std:uintmax_t, std::uintptr_t respectively, equivalent to %X for unsigned int
(macro constant)
Format constants for the std::fscanf family of functions
SCNd8
SCNd16
SCNd32
SCNd64
SCNdLEAST8
SCNdLEAST16
SCNdLEAST32
SCNdLEAST64
SCNdFAST8
SCNdFAST16
SCNdFAST32
SCNdFAST64
SCNdMAX
SCNdPTR
format conversion specifier to input a signed decimal integer value of type std::int8_t, std::int16_t, std::int32_t, std::int64_t, std::int_least8_t, std::int_least16_t, std::int_least32_t, std::int_least64_t, std::int_fast8_t, std::int_fast16_t, std::int_fast32_t, std::int_fast64_t, std:intmax_t, std::intptr_t respectively, equivalent to %d for int
(macro constant)
SCNi8
SCNi16
SCNi32
SCNi64
SCNiLEAST8
SCNiLEAST16
SCNiLEAST32
SCNiLEAST64
SCNiFAST8
SCNiFAST16
SCNiFAST32
SCNiFAST64
SCNiMAX
SCNiPTR
format conversion specifier to input a signed decimal/octal/hexadecimal integer value of type std::int8_t, std::int16_t, std::int32_t, std::int64_t, std::int_least8_t, std::int_least16_t, std::int_least32_t, std::int_least64_t, std::int_fast8_t, std::int_fast16_t, std::int_fast32_t, std::int_fast64_t, std:intmax_t, std::intptr_t respectively, equivalent to %i for int
(macro constant)
SCNu8
SCNu16
SCNu32
SCNu64
SCNuLEAST8
SCNuLEAST16
SCNuLEAST32
SCNuLEAST64
SCNuFAST8
SCNuFAST16
SCNuFAST32
SCNuFAST64
SCNuMAX
SCNuPTR
format conversion specifier to input an unsigned decimal integer value of type std::uint8_t, std::uint16_t, std::uint32_t, std::uint64_t, std::uint_least8_t, std::uint_least16_t, std::uint_least32_t, std::uint_least64_t, std::uint_fast8_t, std::uint_fast16_t, std::uint_fast32_t, std::uint_fast64_t, std:uintmax_t, std::uintptr_t respectively, equivalent to %u for unsigned int
(macro constant)
SCNo8
SCNo16
SCNo32
SCNo64
SCNoLEAST8
SCNoLEAST16
SCNoLEAST32
SCNoLEAST64
SCNoFAST8
SCNoFAST16
SCNoFAST32
SCNoFAST64
SCNoMAX
SCNoPTR
format conversion specifier to input an unsigned octal integer value of type std::uint8_t, std::uint16_t, std::uint32_t, std::uint64_t, std::uint_least8_t, std::uint_least16_t, std::uint_least32_t, std::uint_least64_t, std::uint_fast8_t, std::uint_fast16_t, std::uint_fast32_t, std::uint_fast64_t, std:uintmax_t, std::uintptr_t respectively, equivalent to %o for unsigned int
(macro constant)
SCNx8
SCNx16
SCNx32
SCNx64
SCNxLEAST8
SCNxLEAST16
SCNxLEAST32
SCNxLEAST64
SCNxFAST8
SCNxFAST16
SCNxFAST32
SCNxFAST64
SCNxMAX
SCNxPTR
format conversion specifier to input an unsigned hexadecimal integer value of type std::uint8_t, std::uint16_t, std::uint32_t, std::uint64_t, std::uint_least8_t, std::uint_least16_t, std::uint_least32_t, std::uint_least64_t, std::uint_fast8_t, std::uint_fast16_t, std::uint_fast32_t, std::uint_fast64_t, std:uintmax_t, std::uintptr_t respectively, equivalent to %x for unsigned int
(macro constant)
SCNX8
SCNX16
SCNX32
SCNX64
SCNXLEAST8
SCNXLEAST16
SCNXLEAST32
SCNXLEAST64
SCNXFAST8
SCNXFAST16
SCNXFAST32
SCNXFAST64
SCNXMAX
SCNXPTR
format conversion specifier to input an unsigned uppercase hexadecimal integer value of type std::uint8_t, std::uint16_t, std::uint32_t, std::uint64_t, std::uint_least8_t, std::uint_least16_t, std::uint_least32_t, std::uint_least64_t, std::uint_fast8_t, std::uint_fast16_t, std::uint_fast32_t, std::uint_fast64_t, std:uintmax_t, std::uintptr_t respectively, equivalent to %X for unsigned int
(macro constant)