標準ライブラリヘッダ <cstdint>
提供: cppreference.com
このヘッダは元々 C 標準ライブラリに <stdint.h>
として存在していました。
このヘッダは型サポートライブラリの一部で、固定幅の整数型を提供し、C の数値限界インタフェースの一部です。
目次 |
[編集] 型
ヘッダ
<cstdint> で定義 | |
int8_tint16_tint32_tint64_t (オプション) |
ちょうど 8, 16, 32, 64 ビットの幅を持つ、パディングのない、負の値に2の補数を使用する、符号付き整数型 (処理系がそのような型を直接サポートする場合のみ提供されます) (typedef) |
int_fast8_tint_fast16_tint_fast32_tint_fast64_t |
少なくとも 8, 16, 32, 64 ビットの幅を持つ最も高���な符号付き整数型 (typedef) |
int_least8_tint_least16_tint_least32_tint_least64_t |
少なくとも 8, 16, 32, 64 ビットの幅を持つ最も小さな符号付き整数型 (typedef) |
intmax_t |
最も大きな幅の整数型 (typedef) |
intptr_t (オプション) |
ポインタを保持できる符号付き整数型 (typedef) |
uint8_tuint16_tuint32_tuint64_t (オプション) |
ちょうど 8, 16, 32, 64 ビットの幅を持つ符号なし整数型 (処理系がそのような型を直接サポートする場合のみ提供されます) (typedef) |
uint_fast8_tuint_fast16_tuint_fast32_tuint_fast64_t |
少なくとも 8, 16, 32, 64 ビットの幅を持つ最も高速な符号なし整数型 (typedef) |
uint_least8_tuint_least16_tuint_least32_tuint_least64_t |
少なくとも 8, 16, 32, 64 ビットの幅を持つ最も小さな符号なし整数型 (typedef) |
uintmax_t |
最も大きな幅の符号なし整数型 (typedef) |
uintptr_t (オプション) |
ポインタを保持できる符号なし整数型 (typedef) |
[編集] マクロ
ヘッダ
<cstdint> で定義 | |
符号付き整数の最小値 | |
INT8_MININT16_MININT32_MININT64_MIN (オプション) |
int8_t, int16_t, int32_t, int64_t 型のオブジェクトの最小値 (マクロ定数) |
INT_FAST8_MININT_FAST16_MININT_FAST32_MININT_FAST64_MIN |
int_fast8_t, int_fast16_t, int_fast32_t, int_fast64_t型のオブジェクトの最小値 (マクロ定数) |
INT_LEAST8_MININT_LEAST16_MININT_LEAST32_MININT_LEAST64_MIN |
int_least8_t, int_least16_t, int_least32_t, int_least64_t 型のオブジェクトの最小値 (マクロ定数) |
INTPTR_MIN (オプション) |
intptr_t 型のオブジェクトの最小値 (マクロ定数) |
INTMAX_MIN |
intmax_t 型のオブジェクトの最小値 (マクロ定数) |
符号付き整数の最大値 | |
INT8_MAXINT16_MAXINT32_MAXINT64_MAX (オプション) |
int8_t, int16_t, int32_t, int64_t 型のオブジェクトの最大値 (マクロ定数) |
INT_FAST8_MAXINT_FAST16_MAXINT_FAST32_MAXINT_FAST64_MAX |
int_fast8_t, int_fast16_t, int_fast32_t, int_fast64_t 型のオブジェクトの最大値 (マクロ定数) |
INT_LEAST8_MAXINT_LEAST16_MAXINT_LEAST32_MAXINT_LEAST64_MAX |
int_least8_t, int_least16_t, int_least32_t, int_least64_t 型のオブジェクトの最大値 (マクロ定数) |
INTPTR_MAX (オプション) |
intptr_t 型のオブジェクトの最大値 (マクロ定数) |
INTMAX_MAX |
intmax_t 型のオブジェクトの最大値 (マクロ定数) |
符号なし整数の最大値 | |
UINT8_MAXUINT16_MAXUINT32_MAXUINT64_MAX (オプション) |
uint8_t, uint16_t, uint32_t, uint64_t 型のオブジェクトの最大値 (マクロ定数) |
UINT_FAST8_MAXUINT_FAST16_MAXUINT_FAST32_MAXUINT_FAST64_MAX |
uint_fast8_t, uint_fast16_t, uint_fast32_t, uint_fast64_t 型のオブジェクトの最大値 (マクロ定数) |
UINT_LEAST8_MAXUINT_LEAST16_MAXUINT_LEAST32_MAXUINT_LEAST64_MAX |
uint_least8_t, uint_least16_t, uint_least32_t, uint_least64_t 型のオブジェクトの最大値 (マクロ定数) |
UINTPTR_MAX (オプション) |
uintptr_t 型のオブジェクトの最大値 (マクロ定数) |
UINTMAX_MAX |
uintmax_t 型のオブジェクトの最大値 (マクロ定数) |
その他の整数型の限界 | |
PTRDIFF_MIN (C++11) |
std::ptrdiff_t 型のオブジェクトの最小値 (マクロ定数) |
PTRDIFF_MAX (C++11) |
std::ptrdiff_t 型のオブジェクトの最大値 (マクロ定数) |
SIZE_MAX (C++11) |
std::size_t 型のオブジェクトの最大値 (マクロ定数) |
SIG_ATOMIC_MIN (C++11) |
std::sig_atomic_t 型のオブジェクトの最小値 (マクロ定数) |
SIG_ATOMIC_MAX (C++11) |
std::sig_atomic_t 型のオブジェクトの最大値 (マクロ定数) |
WCHAR_MIN (C++11) |
wchar_t 型のオブジェクトの最小値 (マクロ定数) |
WCHAR_MAX (C++11) |
wchar_t 型のオブジェクトの最大値 (マクロ定数) |
WINT_MIN (C++11) |
std::wint_t 型のオブジェクトの最小値 (マクロ定数) |
WINT_MAX (C++11) |
std::wint_t 型のオブジェクトの最大値 (マクロ定数) |
整数定数のための関数マクロ | |
INT8_CINT16_CINT32_CINT64_C |
引数で指定された値を持つ int_least8_t, int_least16_t, int_least32_t, int_least64_t 型の昇格した型の整数定数式に展開されます (関数マクロ) |
INTMAX_C |
引数で指定された値を持つ intmax_t 型の整数定数式に展開されます (関数マクロ) |
UINT8_CUINT16_CUINT32_CUINT64_C |
引数で指定された値を持つ uint_least8_t, uint_least16_t, uint_least32_t, uint_least64_t 型の昇格した型の整数定数式に展開されます (関数マクロ) |
UINTMAX_C |
引数で指定された値を持つ uintmax_t 型の整数定数式に展開されます (関数マクロ) |
[編集] 概要
namespace std { using int8_t = /* signed integer type */; // optional using int16_t = /* signed integer type */; // optional using int32_t = /* signed integer type */; // optional using int64_t = /* signed integer type */; // optional using intN_t = /* see description */; // optional, see description using int_fast8_t = /* signed integer type */; using int_fast16_t = /* signed integer type */; using int_fast32_t = /* signed integer type */; using int_fast64_t = /* signed integer type */; using int_fastN_t = /* see description */; // optional, see description using int_least8_t = /* signed integer type */; using int_least16_t = /* signed integer type */; using int_least32_t = /* signed integer type */; using int_least64_t = /* signed integer type */; using int_leastN_t = /* see description */; // optional, see description using intmax_t = /* signed integer type */; using intptr_t = /* signed integer type */; // optional using uint8_t = /* unsigned integer type */; // optional using uint16_t = /* unsigned integer type */; // optional using uint32_t = /* unsigned integer type */; // optional using uint64_t = /* unsigned integer type */; // optional using uintN_t = /* see description */; // optional, see description using uint_fast8_t = /* unsigned integer type */; using uint_fast16_t = /* unsigned integer type */; using uint_fast32_t = /* unsigned integer type */; using uint_fast64_t = /* unsigned integer type */; using uint_fastN_t = /* see description */; // optional, see description using uint_least8_t = /* unsigned integer type */; using uint_least16_t = /* unsigned integer type */; using uint_least32_t = /* unsigned integer type */; using uint_least64_t = /* unsigned integer type */; using uint_leastN_t = /* see description */; // optional, see description using uintmax_t = /* unsigned integer type */; using uintptr_t = /* unsigned integer type */; // optional } #define INTN_MIN /* see description */ #define INTN_MAX /* see description */ #define UINTN_MAX /* see description */ #define INT_FASTN_MIN /* see description */ #define INT_FASTN_MAX /* see description */ #define UINT_FASTN_MAX /* see description */ #define INT_LEASTN_MIN /* see description */ #define INT_LEASTN_MAX /* see description */ #define UINT_LEASTN_MAX /* see description */ #define INTMAX_MIN /* see description */ #define INTMAX_MAX /* see description */ #define UINTMAX_MAX /* see description */ #define INTPTR_MIN /* see description */ // optional #define INTPTR_MAX /* see description */ // optional #define UINTPTR_MAX /* see description */ // optional #define PTRDIFF_MIN /* see description */ #define PTRDIFF_MAX /* see description */ #define SIZE_MAX /* see description */ #define SIG_ATOMIC_MIN /* see description */ #define SIG_ATOMIC_MAX /* see description */ #define WCHAR_MIN /* see description */ #define WCHAR_MAX /* see description */ #define WINT_MIN /* see description */ #define WINT_MAX /* see description */ #define INTN_C(value) /* see description */ #define UINTN_C(value) /* see description */ #define INTMAX_C(value) /* see description */ #define UINTMAX_C(value) /* see description */