From Jason Turner

[basic.fundamental]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpe048n5ml/{from.md → to.md} +55 -43
tmp/tmpe048n5ml/{from.md → to.md} RENAMED
@@ -31,32 +31,32 @@ arithmetic yields undefined behavior [[expr.pre]]. — *end note*]
31
  An unsigned integer type has the same object representation, value
32
  representation, and alignment requirements [[basic.align]] as the
33
  corresponding signed integer type. For each value x of a signed integer
34
  type, the value of the corresponding unsigned integer type congruent to
35
  x modulo 2ᴺ has the same value of corresponding bits in its value
36
- representation.[^22]
37
 
38
  [*Example 1*: The value -1 of a signed integer type has the same
39
  representation as the largest value of the corresponding unsigned
40
  type. — *end example*]
41
 
42
  **Table: Minimum width** <a id="basic.fundamental.width">[basic.fundamental.width]</a>
43
 
44
  | Type | Minimum width $N$ |
45
- | ------------- | ----------------- |
46
  | `signed char` | 8 |
47
- | `short` | 16 |
48
  | `int` | 16 |
49
- | `long` | 32 |
50
- | `long long` | 64 |
51
 
52
 
53
  The width of each signed integer type shall not be less than the values
54
  specified in [[basic.fundamental.width]]. The value representation of a
55
  signed or unsigned integer type comprises N bits, where N is the
56
  respective width. Each set of values for any padding bits
57
- [[basic.types]] in the object representation are alternative
58
  representations of the value specified by the value representation.
59
 
60
  [*Note 3*: Padding bits have unspecified value, but cannot cause traps.
61
  In contrast, see ISO C 6.2.6.2. — *end note*]
62
 
@@ -83,30 +83,25 @@ representation, alignment requirements [[basic.align]], and range of
83
  representable values as the underlying type. Further, each value has the
84
  same representation in both types.
85
 
86
  Type `char` is a distinct type that has an *implementation-defined*
87
  choice of “`signed char`” or “`unsigned char`” as its underlying type.
88
- The values of type `char` can represent distinct codes for all members
89
- of the implementation’s basic character set. The three types `char`,
90
- `signed char`, and `unsigned char` are collectively called *ordinary
91
- character types*. The ordinary character types and `char8_t` are
92
- collectively called *narrow character types*. For narrow character
93
- types, each possible bit pattern of the object representation represents
94
- a distinct value.
95
 
96
  [*Note 5*: This requirement does not hold for other
97
  types. — *end note*]
98
 
99
  [*Note 6*: A bit-field of narrow character type whose width is larger
100
  than the width of that type has padding bits; see
101
- [[basic.types]]. — *end note*]
102
 
103
  Type `wchar_t` is a distinct type that has an *implementation-defined*
104
- signed or unsigned integer type as its underlying type. The values of
105
- type `wchar_t` can represent distinct codes for all members of the
106
- largest extended character set specified among the supported locales
107
- [[locale]].
108
 
109
  Type `char8_t` denotes a distinct type whose underlying type is
110
  `unsigned char`. Types `char16_t` and `char32_t` denote distinct types
111
  whose underlying types are `uint_least16_t` and `uint_least32_t`,
112
  respectively, in `<cstdint>`.
@@ -117,53 +112,70 @@ value representation, and alignment requirements as an
117
  `bool` are `true` and `false`.
118
 
119
  [*Note 7*: There are no `signed`, `unsigned`, `short`, or `long bool`
120
  types or values. — *end note*]
121
 
122
- Types `bool`, `char`, `wchar_t`, `char8_t`, `char16_t`, `char32_t`, and
123
- the signed and unsigned integer types are collectively called *integral
 
 
124
  types*. A synonym for integral type is *integer type*.
125
 
126
  [*Note 8*: Enumerations [[dcl.enum]] are not integral; however,
127
  unscoped enumerations can be promoted to integral types as specified in
128
  [[conv.prom]]. — *end note*]
129
 
130
- There are three *floating-point types*: `float`, `double`, and
131
- `long double`. The type `double` provides at least as much precision as
132
- `float`, and the type `long double` provides at least as much precision
133
- as `double`. The set of values of the type `float` is a subset of the
134
- set of values of the type `double`; the set of values of the type
135
- `double` is a subset of the set of values of the type `long double`. The
136
- value representation of floating-point types is
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
  *implementation-defined*.
138
 
139
- [*Note 9*: This document imposes no requirements on the accuracy of
140
- floating-point operations; see also  [[support.limits]]. — *end note*]
141
 
142
- Integral and floating-point types are collectively called *arithmetic*
143
- types. Specializations of the standard library template
144
- `std::numeric_limits` [[support.limits]] shall specify the maximum and
145
- minimum values of each arithmetic type for an implementation.
146
 
147
  A type cv `void` is an incomplete type that cannot be completed; such a
148
  type has an empty set of values. It is used as the return type for
149
  functions that do not return a value. Any expression can be explicitly
150
- converted to type cv `void` ([[expr.type.conv]], [[expr.static.cast]],
151
- [[expr.cast]]). An expression of type cv `void` shall be used only as an
152
- expression statement [[stmt.expr]], as an operand of a comma expression
153
- [[expr.comma]], as a second or third operand of `?:` [[expr.cond]], as
154
- the operand of `typeid`, `noexcept`, or `decltype`, as the expression in
155
- a `return` statement [[stmt.return]] for a function with the return type
156
- cv `void`, or as the operand of an explicit conversion to type
157
- cv `void`.
158
 
159
  A value of type `std::nullptr_t` is a null pointer constant
160
  [[conv.ptr]]. Such values participate in the pointer and the
161
- pointer-to-member conversions ([[conv.ptr]], [[conv.mem]]).
162
  `sizeof(std::nullptr_t)` shall be equal to `sizeof(void*)`.
163
 
164
  The types described in this subclause are called *fundamental types*.
165
 
166
- [*Note 10*: Even if the implementation defines two or more fundamental
167
  types to have the same value representation, they are nevertheless
168
  different types. — *end note*]
169
 
 
31
  An unsigned integer type has the same object representation, value
32
  representation, and alignment requirements [[basic.align]] as the
33
  corresponding signed integer type. For each value x of a signed integer
34
  type, the value of the corresponding unsigned integer type congruent to
35
  x modulo 2ᴺ has the same value of corresponding bits in its value
36
+ representation.[^18]
37
 
38
  [*Example 1*: The value -1 of a signed integer type has the same
39
  representation as the largest value of the corresponding unsigned
40
  type. — *end example*]
41
 
42
  **Table: Minimum width** <a id="basic.fundamental.width">[basic.fundamental.width]</a>
43
 
44
  | Type | Minimum width $N$ |
45
+ | --------------- | ----------------- |
46
  | `signed char` | 8 |
47
+ | `short int` | 16 |
48
  | `int` | 16 |
49
+ | `long int` | 32 |
50
+ | `long long int` | 64 |
51
 
52
 
53
  The width of each signed integer type shall not be less than the values
54
  specified in [[basic.fundamental.width]]. The value representation of a
55
  signed or unsigned integer type comprises N bits, where N is the
56
  respective width. Each set of values for any padding bits
57
+ [[basic.types.general]] in the object representation are alternative
58
  representations of the value specified by the value representation.
59
 
60
  [*Note 3*: Padding bits have unspecified value, but cannot cause traps.
61
  In contrast, see ISO C 6.2.6.2. — *end note*]
62
 
 
83
  representable values as the underlying type. Further, each value has the
84
  same representation in both types.
85
 
86
  Type `char` is a distinct type that has an *implementation-defined*
87
  choice of “`signed char`” or “`unsigned char`” as its underlying type.
88
+ The three types `char`, `signed char`, and `unsigned char` are
89
+ collectively called *ordinary character types*. The ordinary character
90
+ types and `char8_t` are collectively called *narrow character types*.
91
+ For narrow character types, each possible bit pattern of the object
92
+ representation represents a distinct value.
 
 
93
 
94
  [*Note 5*: This requirement does not hold for other
95
  types. — *end note*]
96
 
97
  [*Note 6*: A bit-field of narrow character type whose width is larger
98
  than the width of that type has padding bits; see
99
+ [[basic.types.general]]. — *end note*]
100
 
101
  Type `wchar_t` is a distinct type that has an *implementation-defined*
102
+ signed or unsigned integer type as its underlying type.
 
 
 
103
 
104
  Type `char8_t` denotes a distinct type whose underlying type is
105
  `unsigned char`. Types `char16_t` and `char32_t` denote distinct types
106
  whose underlying types are `uint_least16_t` and `uint_least32_t`,
107
  respectively, in `<cstdint>`.
 
112
  `bool` are `true` and `false`.
113
 
114
  [*Note 7*: There are no `signed`, `unsigned`, `short`, or `long bool`
115
  types or values. — *end note*]
116
 
117
+ The types `char`, `wchar_t`, `char8_t`, `char16_t`, and `char32_t` are
118
+ collectively called *character types*. The character types, `bool`, the
119
+ signed and unsigned integer types, and cv-qualified versions
120
+ [[basic.type.qualifier]] thereof, are collectively termed *integral
121
  types*. A synonym for integral type is *integer type*.
122
 
123
  [*Note 8*: Enumerations [[dcl.enum]] are not integral; however,
124
  unscoped enumerations can be promoted to integral types as specified in
125
  [[conv.prom]]. — *end note*]
126
 
127
+ The three distinct types `float`, `double`, and `long double` can
128
+ represent floating-point numbers. The type `double` provides at least as
129
+ much precision as `float`, and the type `long double` provides at least
130
+ as much precision as `double`. The set of values of the type `float` is
131
+ a subset of the set of values of the type `double`; the set of values of
132
+ the type `double` is a subset of the set of values of the type
133
+ `long double`. The types `float`, `double`, and `long double`, and
134
+ cv-qualified versions [[basic.type.qualifier]] thereof, are collectively
135
+ termed *standard floating-point types*. An implementation may also
136
+ provide additional types that represent floating-point values and define
137
+ them (and cv-qualified versions thereof) to be *extended floating-point
138
+ types*. The standard and extended floating-point types are collectively
139
+ termed *floating-point types*.
140
+
141
+ [*Note 9*: Any additional implementation-specific types representing
142
+ floating-point values that are not defined by the implementation to be
143
+ extended floating-point types are not considered to be floating-point
144
+ types, and this document imposes no requirements on them or their
145
+ interactions with floating-point types. — *end note*]
146
+
147
+ Except as specified in [[basic.extended.fp]], the object and value
148
+ representations and accuracy of operations of floating-point types are
149
  *implementation-defined*.
150
 
151
+ Integral and floating-point types are collectively termed *arithmetic
152
+ types*.
153
 
154
+ [*Note 10*: Properties of the arithmetic types, such as their minimum
155
+ and maximum representable value, can be queried using the facilities in
156
+ the standard library headers `<limits>`, `<climits>`, and
157
+ `<cfloat>`. *end note*]
158
 
159
  A type cv `void` is an incomplete type that cannot be completed; such a
160
  type has an empty set of values. It is used as the return type for
161
  functions that do not return a value. Any expression can be explicitly
162
+ converted to type cv `void`
163
+ [[expr.type.conv]], [[expr.static.cast]], [[expr.cast]]. An expression
164
+ of type cv `void` shall be used only as an expression statement
165
+ [[stmt.expr]], as an operand of a comma expression [[expr.comma]], as a
166
+ second or third operand of `?:` [[expr.cond]], as the operand of
167
+ `typeid`, `noexcept`, or `decltype`, as the expression in a `return`
168
+ statement [[stmt.return]] for a function with the return type cv `void`,
169
+ or as the operand of an explicit conversion to type cv `void`.
170
 
171
  A value of type `std::nullptr_t` is a null pointer constant
172
  [[conv.ptr]]. Such values participate in the pointer and the
173
+ pointer-to-member conversions [[conv.ptr]], [[conv.mem]].
174
  `sizeof(std::nullptr_t)` shall be equal to `sizeof(void*)`.
175
 
176
  The types described in this subclause are called *fundamental types*.
177
 
178
+ [*Note 11*: Even if the implementation defines two or more fundamental
179
  types to have the same value representation, they are nevertheless
180
  different types. — *end note*]
181