1Objects declared as characters (
char) shall be large enough to store any member of the
implementation’s basic character set. If a character from this set is stored in a character object, the integral value
of that character object is equal to the value of the single character literal form of that character. It is
implementation-defined whether a
char object can hold negative values.
Characters can be explicitly
signed char, and
unsigned char are three distinct types. A
signed char, and an
unsigned char occupy the same amount of storage and have the same alignment requirements (3.11);
that is, they have the same object representation. For character types, all bits of the object representation
participate in the value representation. For unsigned character types, all possible bit patterns of the value
representation represent numbers. These requirements do not hold for other types. In any particular implementation, a
char object can take on either the same values as a
signed char or an
char; which one is implementation-defined.
There are five standard signed integer types:
signed char”, “
long int”, and “
long long int”. In thins list, each type provides at least
as much storage as those preceding it in the list. There may also be implementation-defined
extended signed integer types.
The standard and extended signed integer types are collectively called
signed integer types.
ints have the natural size suggested by the architecture of the execution environment44;
the other signed integer types are provided to meet special needs.
For each of the standard signed integer types, there exists a corresponding (but different)
standard unsigned integer type:
unsigned char”, “
unsigned short int”, “
unsigned long int”, and “
unsigned long long int”, each of which occupies the
same amount of storage and has the same alignment requirements (3.11) as the corresponding signed integer
type45; that is, each signed integer type has the same object representation as its corresponding unsigned
integer type. Likewise, for each of the extended signed integer types there exists a corresponding
extended unsigned integer type
with the same amount of storage and alignment requirements. The standard and extended
unsigned integer types are collectively called
unsigned integer types. The range of non-negative values of a
signed integer type is a subrange of the corresponding unsigned integer type, and the value representation of each
corresponding signed/unsigned type shall be the same. The standard signed integer ntypes and standard unsigned integer
types are collectively called the standard integer types,
and the extended signed integer types and extended unsigned integer types are collectively called the
extended integer types.
Unsigned integers, declared
unsigned, shall obey the laws of arithmetic modulo
2n where n is the number of bits in the value representation of that particular size of
wchar_t is a distinct type whose values can represent distinct codes for all members of the
largest extended character set specified among the supported locales (22.3.1). Type
shall have the same size, signedness, and alignment requirements (3.11) as one of the other integral types,
called its underlying type. Types
char32_t denote distinct types with
the same size, signedness, and alignment as
<stdint.h>, called the underlying types.
Values of type
bool are either
false.47 [ Note: There
bool types or
values. — end note ] Values of type
bool participate in integral promotions (4.5).
and the signed and unsigned integer types are collectively called integral types.48 A synonym for
integral type is integer type. The representations of integral types shall define values by use of a pure
binary numeration system.49 [ Example: this International Standard permits 2’s complement, 1’s complement and
signed magnitude representations for integral types. — end example ]
8There are three floating point types:
double provides at least as much precision as
float, and the type
long double provides at least as much precision as
double. The set of values of the type
float is a subset of the set of values of the type
double; the set of values of the type
double is a subset of the set of values of the type
long double. The value representation of
floating-point types is implementation-defined.
Integral and floating types are collectively called
Specializations of the standard template
std::numeric_limits (18.3) shall specify
the maximum and minimum values of each arithmetic type for an implementation.
void type has an empty set of values.
void type is an incomplete type that
cannot be completed. It is used as the return type for functions that do not return a value. Any expression can be
explicitly converted to type cv
void (5.4). An expression of type
shall be used only as an expression statement (6.2), as an operand of a comma expression (5.18),
as a second or third operand of
?: (5.16), as the operand of
decltype, as the expression in a return statement (6.6.3) for a function with the return type
void, or as the operand of an explicit conversion to type cv
10A value of type
std::nullptr_t is a null pointer constant (4.10). Such values
participate in the pointer and the pointer to member conversions (4.10, 4.11).
sizeof(std::nullptr_t) shall be equal to
11[ Note: Even if the implementation defines two or more basic types to have the same value representation, they are nevertheless different types. — end note ]
44) that is, large enough to contain any value in the range of
INT_MAX, as defined in the header
45) See 220.127.116.11 regarding the correspondence between types and the sequences of type-specifiers that designate them.
46) This implies that unsigned arithmetic does not overflow because a result that cannot be represented by the resulting unsigned integer type is reduced modulo the number that is one greater than the largest value that can be represented by the resulting unsigned integer type.
47) Using a
bool value in ways described by this International Standard as “undefined”, such
as by examining the value of an uninitialized automatic object, might cause it to behave as if it is neither
49) A positional representation for integers that uses the binary digits 0 and 1, in which the values represented by successive bits are additive, begin with 1, and are multiplied by successive integral power of 2, except perhaps for the bit with the highest position. (Adapted from the American National Dictionary for Information Processing Systems.)