From Jason Turner

[basic.fundamental]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmperuyupca/{from.md → to.md} +58 -38
tmp/tmperuyupca/{from.md → to.md} RENAMED
@@ -10,47 +10,54 @@ declared `unsigned` or `signed`. Plain `char`, `signed char`, and
10
  `unsigned char` are three distinct types, collectively called *narrow
11
  character types*. A `char`, a `signed char`, and an `unsigned char`
12
  occupy the same amount of storage and have the same alignment
13
  requirements ([[basic.align]]); that is, they have the same object
14
  representation. For narrow character types, all bits of the object
15
- representation participate in the value representation. For unsigned
16
- narrow character types, all possible bit patterns of the value
17
- representation represent numbers. These requirements do not hold for
18
- other types. In any particular implementation, a plain `char` object can
19
- take on either the same values as a `signed char` or an `unsigned
 
 
 
 
 
 
20
  char`; which one is *implementation-defined*. For each value *i* of type
21
  `unsigned char` in the range 0 to 255 inclusive, there exists a value
22
  *j* of type `char` such that the result of an integral conversion (
23
  [[conv.integral]]) from *i* to `char` is *j*, and the result of an
24
  integral conversion from *j* to `unsigned char` is *i*.
25
 
26
  There are five *standard signed integer types* : “`signed char`”,
27
- “`short int`”, “`int`”, “`long int`”, and “`long` `long` `int`”. In this
28
  list, each type provides at least as much storage as those preceding it
29
  in the list. There may also be *implementation-defined* *extended signed
30
  integer types*. The standard and extended signed integer types are
31
  collectively called *signed integer types*. Plain `int`s have the
32
- natural size suggested by the architecture of the execution
33
- environment[^22]; the other signed integer types are provided to meet
34
- special needs.
35
 
36
  For each of the standard signed integer types, there exists a
37
  corresponding (but different) *standard unsigned integer type*:
38
  “`unsigned char`”, “`unsigned short int`”, “`unsigned int`”,
39
- “`unsigned long int`”, and “`unsigned` `long` `long` `int`”, each of
40
- which occupies the same amount of storage and has the same alignment
41
  requirements ([[basic.align]]) as the corresponding signed integer
42
  type[^23]; that is, each signed integer type has the same object
43
  representation as its corresponding unsigned integer type. Likewise, for
44
  each of the extended signed integer types there exists a corresponding
45
  *extended unsigned integer type* with the same amount of storage and
46
  alignment requirements. The standard and extended unsigned integer types
47
  are collectively called *unsigned integer types*. The range of
48
- non-negative values of a *signed integer* type is a subrange of the
49
- corresponding *unsigned integer* type, and the value representation of
50
- each corresponding signed/unsigned type shall be the same. The standard
51
- signed integer types and standard unsigned integer types are
 
52
  collectively called the *standard integer types*, and the extended
53
  signed integer types and extended unsigned integer types are
54
  collectively called the *extended integer types*. The signed and
55
  unsigned integer types shall satisfy the constraints given in the C
56
  standard, section 5.2.4.2.1.
@@ -66,49 +73,62 @@ same size, signedness, and alignment requirements ([[basic.align]]) as
66
  one of the other integral types, called its *underlying type*. Types
67
  `char16_t` and `char32_t` denote distinct types with the same size,
68
  signedness, and alignment as `uint_least16_t` and `uint_least32_t`,
69
  respectively, in `<cstdint>`, called the underlying types.
70
 
71
- Values of type `bool` are either `true` or `false`.[^25] There are no
72
- `signed`, `unsigned`, `short`, or `long bool` types or values. Values of
73
- type `bool` participate in integral promotions ([[conv.prom]]).
 
 
 
 
74
 
75
  Types `bool`, `char`, `char16_t`, `char32_t`, `wchar_t`, and the signed
76
  and unsigned integer types are collectively called *integral*
77
  types.[^26] A synonym for integral type is *integer type*. The
78
  representations of integral types shall define values by use of a pure
79
- binary numeration system.[^27] this International Standard permits 2’s
80
- complement, 1’s complement and signed magnitude representations for
81
- integral types.
82
 
83
- There are three *floating point* types: `float`, `double`, and
 
 
 
 
84
  `long double`. The type `double` provides at least as much precision as
85
  `float`, and the type `long double` provides at least as much precision
86
  as `double`. The set of values of the type `float` is a subset of the
87
  set of values of the type `double`; the set of values of the type
88
- `double` is a subset of the set of values of the type `long` `double`.
89
- The value representation of floating-point types is
90
- *implementation-defined*. *Integral* and *floating* types are
91
- collectively called *arithmetic* types. Specializations of the standard
92
- template `std::numeric_limits` ([[support.limits]]) shall specify the
93
- maximum and minimum values of each arithmetic type for an
94
- implementation.
95
 
96
- The `void` type has an empty set of values. The `void` type is an
97
- incomplete type that cannot be completed. It is used as the return type
98
- for functions that do not return a value. Any expression can be
99
- explicitly converted to type *cv* `void` ([[expr.cast]]). An expression
100
- of type `void` shall be used only as an expression statement (
 
 
 
 
 
 
 
 
 
101
  [[stmt.expr]]), as an operand of a comma expression ([[expr.comma]]),
102
  as a second or third operand of `?:` ([[expr.cond]]), as the operand of
103
  `typeid`, `noexcept`, or `decltype`, as the expression in a return
104
- statement ([[stmt.return]]) for a function with the return type `void`,
105
- or as the operand of an explicit conversion to type cv `void`.
 
106
 
107
  A value of type `std::nullptr_t` is a null pointer constant (
108
  [[conv.ptr]]). Such values participate in the pointer and the pointer to
109
  member conversions ([[conv.ptr]], [[conv.mem]]).
110
  `sizeof(std::nullptr_t)` shall be equal to `sizeof(void*)`.
111
 
112
- Even if the implementation defines two or more basic types to have the
113
- same value representation, they are nevertheless different types.
 
114
 
 
10
  `unsigned char` are three distinct types, collectively called *narrow
11
  character types*. A `char`, a `signed char`, and an `unsigned char`
12
  occupy the same amount of storage and have the same alignment
13
  requirements ([[basic.align]]); that is, they have the same object
14
  representation. For narrow character types, all bits of the object
15
+ representation participate in the value representation.
16
+
17
+ [*Note 1*: A bit-field of narrow character type whose length is larger
18
+ than the number of bits in the object representation of that type has
19
+ padding bits; see  [[class.bit]]. *end note*]
20
+
21
+ For unsigned narrow character types, each possible bit pattern of the
22
+ value representation represents a distinct number. These requirements do
23
+ not hold for other types. In any particular implementation, a plain
24
+ `char` object can take on either the same values as a `signed char` or
25
+ an `unsigned
26
  char`; which one is *implementation-defined*. For each value *i* of type
27
  `unsigned char` in the range 0 to 255 inclusive, there exists a value
28
  *j* of type `char` such that the result of an integral conversion (
29
  [[conv.integral]]) from *i* to `char` is *j*, and the result of an
30
  integral conversion from *j* to `unsigned char` is *i*.
31
 
32
  There are five *standard signed integer types* : “`signed char`”,
33
+ “`short int`”, “`int`”, “`long int`”, and “`long long int`”. In this
34
  list, each type provides at least as much storage as those preceding it
35
  in the list. There may also be *implementation-defined* *extended signed
36
  integer types*. The standard and extended signed integer types are
37
  collectively called *signed integer types*. Plain `int`s have the
38
+ natural size suggested by the architecture of the execution environment
39
+ [^22]; the other signed integer types are provided to meet special
40
+ needs.
41
 
42
  For each of the standard signed integer types, there exists a
43
  corresponding (but different) *standard unsigned integer type*:
44
  “`unsigned char`”, “`unsigned short int`”, “`unsigned int`”,
45
+ “`unsigned long int`”, and “`unsigned long long int`”, each of which
46
+ occupies the same amount of storage and has the same alignment
47
  requirements ([[basic.align]]) as the corresponding signed integer
48
  type[^23]; that is, each signed integer type has the same object
49
  representation as its corresponding unsigned integer type. Likewise, for
50
  each of the extended signed integer types there exists a corresponding
51
  *extended unsigned integer type* with the same amount of storage and
52
  alignment requirements. The standard and extended unsigned integer types
53
  are collectively called *unsigned integer types*. The range of
54
+ non-negative values of a signed integer type is a subrange of the
55
+ corresponding unsigned integer type, the representation of the same
56
+ value in each of the two types is the same, and the value representation
57
+ of each corresponding signed/unsigned type shall be the same. The
58
+ standard signed integer types and standard unsigned integer types are
59
  collectively called the *standard integer types*, and the extended
60
  signed integer types and extended unsigned integer types are
61
  collectively called the *extended integer types*. The signed and
62
  unsigned integer types shall satisfy the constraints given in the C
63
  standard, section 5.2.4.2.1.
 
73
  one of the other integral types, called its *underlying type*. Types
74
  `char16_t` and `char32_t` denote distinct types with the same size,
75
  signedness, and alignment as `uint_least16_t` and `uint_least32_t`,
76
  respectively, in `<cstdint>`, called the underlying types.
77
 
78
+ Values of type `bool` are either `true` or `false`.[^25]
79
+
80
+ [*Note 2*: There are no `signed`, `unsigned`, `short`, or `long bool`
81
+ types or values. — *end note*]
82
+
83
+ Values of type `bool` participate in integral promotions (
84
+ [[conv.prom]]).
85
 
86
  Types `bool`, `char`, `char16_t`, `char32_t`, `wchar_t`, and the signed
87
  and unsigned integer types are collectively called *integral*
88
  types.[^26] A synonym for integral type is *integer type*. The
89
  representations of integral types shall define values by use of a pure
90
+ binary numeration system.[^27]
 
 
91
 
92
+ [*Example 1*: This International Standard permits two’s complement,
93
+ ones’ complement and signed magnitude representations for integral
94
+ types. — *end example*]
95
+
96
+ There are three *floating-point* types: `float`, `double`, and
97
  `long double`. The type `double` provides at least as much precision as
98
  `float`, and the type `long double` provides at least as much precision
99
  as `double`. The set of values of the type `float` is a subset of the
100
  set of values of the type `double`; the set of values of the type
101
+ `double` is a subset of the set of values of the type `long double`. The
102
+ value representation of floating-point types is
103
+ *implementation-defined*.
 
 
 
 
104
 
105
+ [*Note 3*: This International Standard imposes no requirements on the
106
+ accuracy of floating-point operations; see also 
107
+ [[support.limits]]. *end note*]
108
+
109
+ Integral and floating types are collectively called *arithmetic* types.
110
+ Specializations of the standard library template `std::numeric_limits` (
111
+ [[support.limits]]) shall specify the maximum and minimum values of each
112
+ arithmetic type for an implementation.
113
+
114
+ A type cv `void` is an incomplete type that cannot be completed; such a
115
+ type has an empty set of values. It is used as the return type for
116
+ functions that do not return a value. Any expression can be explicitly
117
+ converted to type cv `void` ([[expr.cast]]). An expression of type
118
+ cv `void` shall be used only as an expression statement (
119
  [[stmt.expr]]), as an operand of a comma expression ([[expr.comma]]),
120
  as a second or third operand of `?:` ([[expr.cond]]), as the operand of
121
  `typeid`, `noexcept`, or `decltype`, as the expression in a return
122
+ statement ([[stmt.return]]) for a function with the return type
123
+ cv `void`, or as the operand of an explicit conversion to type
124
+ cv `void`.
125
 
126
  A value of type `std::nullptr_t` is a null pointer constant (
127
  [[conv.ptr]]). Such values participate in the pointer and the pointer to
128
  member conversions ([[conv.ptr]], [[conv.mem]]).
129
  `sizeof(std::nullptr_t)` shall be equal to `sizeof(void*)`.
130
 
131
+ [*Note 4*: Even if the implementation defines two or more basic types
132
+ to have the same value representation, they are nevertheless different
133
+ types. — *end note*]
134