[ Web Proxy ]
URL:
Viewing: http://ru.cppreference.com/cpp/language/types [Back]  [Original]

cppreference.com
cppreference.com

cppreference.com

( , , C++)

void

void - . , (, void ). void, void. , void void ( ) .

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 (int 16-, long 32-)
  • Win16 API
  • ILP32 4/4/4 (int, long, 32-);
  • Win32 API
  • Unix Unix- (Linux, macOS)

64- :

  • LLP64 4/4/8 (int long 32-, 64-)
  • LP64 4/8/8 (int 32-, long 64-)
  • Unix Unix- (Linux, macOS)

. , ILP64 (8/8/8: int, long 64-) 64- Unix ( UNICOS Cray).

int . int , - , . , 16 . 32/64 32 ( ).

. . .

signed - ( , )
unsigned -
short - 16 .
long - 32 .

long long - 64 .
( 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)

. , .

bool , : true false. sizeof(bool) 1.

signed char - .
unsigned char - . ( ).
char - , ( , signed char unsigned char, ). . unsigned char [0255] char unsigned char . ( C++11). char : ARM PowerPC , x86 x64 .
wchar_t - ( ). , , , . 32- UTF-32 Linux , Windows, Windows 16- UTF-16. , wchar_t , . Windows, P2460R2.

char16_t - UTF-16, UTF-16 (16 ). , , std::uint_least16_t, .

char32_t - UTF-32, UTF-32 (32 ). , , std::uint_least32_t, .
( C++11)

char8_t - UTF-8, UTF-8 (8 ). , , unsigned char (, , , char signed char), .
( 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)

. .

:

+, -, / *, cmath. , errno, math_errhandling

, , FLT_EVAL_METHOD. , , , #pragma STDC FP_CONTRACT.

( ) ( , ).

.

std::numeric_limits , .

.

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
  • :
    1.401,298,4 10{sup|45}}
  • :
    1.175,494,3 1038
  • :
    3.402,823,4 1038
  • :
    0x1p-149
  • :
    0x1p-126
  • :
    0x1.fffffep+127
64 IEEE-754
  • :
    4.940,656,458,412 10324
  • :
     2.225,073,858,507,201,4  10308
  • :
     1.797,693,134,862,315,7  10308
  • :
    0x1p-1074
  • :
    0x1p-1022
  • :
    0x1.fffffffffffffp+1023
80[ 1] x86
  • :
    3.645,199,531,882,474,602,528
      104951
  • :
     3.362,103,143,112,093,506,263
      104932
  • :
     1.189,731,495,357,231,765,021
      104932
  • :
    0x1p-16445
  • :
    0x1p-16382
  • :
    0x1.fffffffffffffffep+16383
128 IEEE-754
  • :
    6.475,175,119,438,025,110,924,
    438,958,227,646,552,5 104966
  • :
     3.362,103,143,112,093,506,262,
    677,817,321,752,602,6  104932
  • :
     1.189,731,495,357,231,765,085,
    759,326,628,007,016,2  104932
  • :
    0x1p-16494
  • :
    0x1p-16382
  • :
    0x1.ffffffffffffffffffffffffffff
    p+16383
  1. 96/128 32/64- .

: ( ) , , 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 , ,


Web Proxy Viewer  |  New URL  |  Original Page