標準ライブラリヘッダー <cstdint> (C++11)
From cppreference.com
このヘッダーは、元々C標準ライブラリの<stdint.h>として存在していました。
このヘッダーは型サポートライブラリの一部であり、固定幅整数型とC数値制限インターフェースの一部を提供します。
型 | ||
| 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 (オプション) |
voidへのポインタを保持できる符号付き整数型 (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 (オプション) |
voidへのポインタを保持できる符号なし整数型 (typedef) | |
マクロ | ||
符号付き整数: 最小値 | ||
| INT8_MININT16_MININT32_MININT64_MIN (オプション) |
それぞれ`std::int8_t`、`std::int16_t`、`std::int32_t`、`std::int64_t`の最小値 (マクロ定数) | |
| INT_FAST8_MININT_FAST16_MININT_FAST32_MININT_FAST64_MIN |
それぞれ`std::int_fast8_t`、`std::int_fast16_t`、`std::int_fast32_t`、`std::int_fast64_t`の最小値 (マクロ定数) | |
| INT_LEAST8_MININT_LEAST16_MININT_LEAST32_MININT_LEAST64_MIN |
それぞれ`std::int_least8_t`、`std::int_least16_t`、`std::int_least32_t`、`std::int_least64_t`の最小値 (マクロ定数) | |
| INTPTR_MIN (オプション) |
`std::intptr_t`の最小値 (マクロ定数) | |
| INTMAX_MIN |
`std::intmax_t`の最小値 (マクロ定数) | |
符号付き整数: 最大値 | ||
| INT8_MAXINT16_MAXINT32_MAXINT64_MAX (オプション) |
それぞれ`std::int8_t`、`std::int16_t`、`std::int32_t`、`std::int64_t`の最大値 (マクロ定数) | |
| INT_FAST8_MAXINT_FAST16_MAXINT_FAST32_MAXINT_FAST64_MAX |
それぞれ`std::int_fast8_t`、`std::int_fast16_t`、`std::int_fast32_t`、`std::int_fast64_t`の最大値 (マクロ定数) | |
| INT_LEAST8_MAXINT_LEAST16_MAXINT_LEAST32_MAXINT_LEAST64_MAX |
それぞれ`std::int_least8_t`、`std::int_least16_t`、`std::int_least32_t`、`std::int_least64_t`の最大値 (マクロ定数) | |
| INTPTR_MAX (オプション) |
`std::intptr_t`の最大値 (マクロ定数) | |
| INTMAX_MAX |
`std::intmax_t`の最大値 (マクロ定数) | |
符号なし整数: 最大値 | ||
| UINT8_MAXUINT16_MAXUINT32_MAXUINT64_MAX (オプション) |
それぞれ`std::uint8_t`、`std::uint16_t`、`std::uint32_t`、`std::uint64_t`の最大値 (マクロ定数) | |
| UINT_FAST8_MAXUINT_FAST16_MAXUINT_FAST32_MAXUINT_FAST64_MAX |
それぞれ`std::uint_fast8_t`、`std::uint_fast16_t`、`std::uint_fast32_t`、`std::uint_fast64_t`の最大値 (マクロ定数) | |
| UINT_LEAST8_MAXUINT_LEAST16_MAXUINT_LEAST32_MAXUINT_LEAST64_MAX |
それぞれ`std::uint_least8_t`、`std::uint_least16_t`、`std::uint_least32_t`、`std::uint_least64_t`の最大値 (マクロ定数) | |
| UINTPTR_MAX (オプション) |
`std::uintptr_t`の最大値 (マクロ定数) | |
| UINTMAX_MAX |
`std::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 |
引数で指定された値を持ち、その型がそれぞれ`std::int_least8_t`、`std::int_least16_t`、`std::int_least32_t`、`std::int_least64_t`の昇格された型である整数定数式に展開されます (関数マクロ) | |
| INTMAX_C |
引数で指定された値を持ち、型が`std::intmax_t`である整数定数式に展開されます (関数マクロ) | |
| UINT8_CUINT16_CUINT32_CUINT64_C |
引数で指定された値を持ち、その型がそれぞれ`std::uint_least8_t`、`std::uint_least16_t`、`std::uint_least32_t`、`std::uint_least64_t`の昇格された型である整数定数式に展開されます (関数マクロ) | |
| UINTMAX_C |
引数で指定された値を持ち、型が`std::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 */