( , , C++)
void
void- . , (,void).void,void. ,voidvoid( ) .
std::nullptr_t ( C++11)
<tbody> </tbody> typedef decltype(nullptr) nullptr_t; |
( C++11) | |
std::nullptr_t , nullptr. , . ( NULL) .
sizeof(std::nullptr_t) sizeof(void *).
, , . :
32- :
- LP32 2/4/4 (
int16-,long32-)
- Win16 API
- ILP32 4/4/4 (
int,long, 32-);
- Win32 API
- Unix Unix- (Linux, macOS)
- LP32 2/4/4 (
64- :
- LLP64 4/4/8 (
intlong32-, 64-)
- Win32 API ( Windows API) 64-bit ARM (AArch64) x86-64 ( x64)
- LP64 4/8/8 (
int32-,long64-)
- Unix Unix- (Linux, macOS)
- LLP64 4/4/8 (
. , ILP64 (8/8/8: int, long 64-) 64- Unix ( UNICOS Cray).
int.int, - , . , 16 . 32/64 32 ( ).
. . .
signed- ( , )unsigned-
short- 16 .long- 32 .
|
|
( C++11) |
: , : unsigned long long int long int unsigned long .
{anchor|Integer properties}}
:
| C++ | LP32 | ILP32 | LLP64 | LP64 | ||
|---|---|---|---|---|---|---|
short |
short int
|
16 |
16 | 16 | 16 | 16 |
short int | ||||||
signed short | ||||||
signed short int | ||||||
unsigned short |
unsigned short int
| |||||
unsigned short int | ||||||
int |
int
|
16 |
16 | 32 | 32 | 32 |
signed | ||||||
signed int | ||||||
unsigned |
unsigned int
| |||||
unsigned int | ||||||
long |
long int
|
32 |
32 | 32 | 32 | 64 |
long int | ||||||
signed long | ||||||
signed long int | ||||||
unsigned long |
unsigned long int
| |||||
unsigned long int | ||||||
long long |
long long int (C++11) |
64 |
64 | 64 | 64 | 64 |
long long int | ||||||
signed long long | ||||||
signed long long int | ||||||
unsigned long long |
unsigned long long int (C++11) | |||||
unsigned long long int | ||||||
std::size_t sizeof , sizeof... alignof ( C++11).
( C++11)
signed char- .unsigned char- . ( ).char- , ( ,signed charunsigned char, ). .unsigned char[0,255]charunsigned char. ( C++11).char: ARM PowerPC , x86 x64 .wchar_t- ( ). , , , . 32- UTF-32 Linux , Windows, Windows 16- UTF-16. ,wchar_t, . Windows, P2460R2.
|
|
( C++11) |
|
|
( C++20) |
, C++ ,
1==sizeof(char)≤sizeof(short)≤sizeof(int)≤sizeof(long)≤sizeof(long long).
: , 64 , ( char) 64 , sizeof 1 .
cv- .
float- . IEEE-754 binary32, .double- . IEEE-754 binary64, .long double- . IEEE-754 binary128, , IEEE-754 binary64- , , , IEEE-754, , binary64, binary64, IEEE-754 binary64.- binary128 HP-UX, SPARC, MIPS, ARM64 z/OS.
- IEEE-754 binary64- 80- . x86 x86-64 ( MSVC,
long double,double, binary64).
( C++23)
- ( ), INFINITY
- ,
-0.0. , ,1.0/0.0 == INFINITY,1.0/-0.0 == -INFINITY), , sqrt(std::complex) - (NaN - not-a-number), ( ). NaN, std::nan, NAN. , C++ NaN, std::numeric_limits::has_signaling_NaN, NaN .
+, -, / *, cmath. , errno, math_errhandling
, , FLT_EVAL_METHOD. , , , #pragma STDC FP_CONTRACT.
.
C++20 C++ , N- \(\scriptsize -(2^{N-1}-1)\)-(2N-1
-1) \(\scriptsize +2^{N-1}-1\)+2N-1
-1 ( -127 127 8- ), .
C++ , , C++20, , , \(\scriptsize -2^{N-1}\)-2N-1
\(\scriptsize +2^{N-1}-1\)+2N-1
-1 ( -128 127 8- ).
8- , char C++11 ( CWG 1759), UTF-8 0x80, UTF-8, char.
| 8 | -128 127 | |||
| 0 255 | ||||
| 16 | UTF-16 | 0 65535 | ||
| 32 | UTF-32 | 0 1114111 (0x10ffff) | ||
| 16 | 3.27 104 | -32768 32767 | ||
| 0 6.55 104 | 0 65535 | |||
| 32 | 2.14 109 | -2,147,483,648 2,147,483,647 | ||
| 0 4.29 109 | 0 4,294,967,295 | |||
| 64 | 9.22 1018 | -9,223,372,036,854,775,808 9,223,372,036,854,775,807 | ||
| 0 1.84 1019 | 0 18,446,744,073,709,551,615 | |||
| 32 | IEEE-754 |
|
| |
| 64 | IEEE-754 |
|
| |
| 80[ 1] | x86 |
|
| |
| 128 | IEEE-754 |
|
| |
: ( ) , , C std::numeric_limits
__cpp_unicode_characters |
200704L |
(C++11) | (char16_t char32_t)
|
__cpp_char8_t |
201811L |
(C++20) | char8_t
|
202207L |
(C++23) | char8_t ( (unsigned) char UTF-8)
|
void, bool, true, false, char, wchar_t, char8_t, char16_t, char32_t, int, short, long, signed, unsigned, float, double
C++:
| CWG 238 | C++98 | , , | |
| CWG 1759 | c++11 | char , UTF-8 0x80
|
|
| WG | C++98 | wchar_t , ,
|