tmp/tmpidgsu0ob/{from.md → to.md}
RENAMED
|
@@ -7,16 +7,16 @@ library. [[structure]] describes the structure of the normative Clauses
|
|
| 7 |
|
| 8 |
### Structure of each clause <a id="structure">[[structure]]</a>
|
| 9 |
|
| 10 |
#### Elements <a id="structure.elements">[[structure.elements]]</a>
|
| 11 |
|
| 12 |
-
Each library clause contains the following elements, as applicable:[^
|
| 13 |
|
| 14 |
- Summary
|
| 15 |
- Requirements
|
| 16 |
- Detailed specifications
|
| 17 |
-
- References to the
|
| 18 |
|
| 19 |
#### Summary <a id="structure.summary">[[structure.summary]]</a>
|
| 20 |
|
| 21 |
The Summary provides a synopsis of the category, and introduces the
|
| 22 |
first-level subclauses. Each subclause also provides a summary, listing
|
|
@@ -50,12 +50,12 @@ The string and iostream components use an explicit representation of
|
|
| 50 |
operations required of template arguments. They use a class template
|
| 51 |
`char_traits` to define these constraints.
|
| 52 |
|
| 53 |
Interface convention requirements are stated as generally as possible.
|
| 54 |
Instead of stating “class X has to define a member function
|
| 55 |
-
`operator++()`
|
| 56 |
-
`X`, `++x` is defined
|
| 57 |
unspecified.
|
| 58 |
|
| 59 |
Requirements are stated in terms of well-defined expressions that define
|
| 60 |
valid terms of the types that satisfy the requirements. For every set of
|
| 61 |
well-defined expression requirements there is a table that specifies an
|
|
@@ -68,34 +68,34 @@ Template argument requirements are sometimes referenced by name. See
|
|
| 68 |
[[type.descriptions]].
|
| 69 |
|
| 70 |
In some cases the semantic requirements are presented as C++code. Such
|
| 71 |
code is intended as a specification of equivalence of a construct to
|
| 72 |
another construct, not necessarily as the way the construct must be
|
| 73 |
-
implemented.[^
|
| 74 |
|
| 75 |
#### Detailed specifications <a id="structure.specifications">[[structure.specifications]]</a>
|
| 76 |
|
| 77 |
The detailed specifications each contain the following elements:
|
| 78 |
|
| 79 |
- name and brief description
|
| 80 |
-
- synopsis (class definition or function
|
| 81 |
- restrictions on template arguments, if any
|
| 82 |
- description of class invariants
|
| 83 |
- description of function semantics
|
| 84 |
|
| 85 |
Descriptions of class member functions follow the order (as
|
| 86 |
-
appropriate):[^
|
| 87 |
|
| 88 |
- constructor(s) and destructor
|
| 89 |
- copying, moving & assignment functions
|
| 90 |
- comparison functions
|
| 91 |
- modifier functions
|
| 92 |
- observer functions
|
| 93 |
- operators and other non-member functions
|
| 94 |
|
| 95 |
Descriptions of function semantics contain the following elements (as
|
| 96 |
-
appropriate):[^
|
| 97 |
|
| 98 |
- *Requires:* the preconditions for calling the function
|
| 99 |
- *Effects:* the actions performed by the function
|
| 100 |
- *Synchronization:* the synchronization operations (
|
| 101 |
[[intro.multithread]]) applicable to the function
|
|
@@ -104,24 +104,23 @@ appropriate):[^5]
|
|
| 104 |
- *Throws:* any exceptions thrown by the function, and the conditions
|
| 105 |
that would cause the exception
|
| 106 |
- *Complexity:* the time and/or space complexity of the function
|
| 107 |
- *Remarks:* additional semantic constraints on the function
|
| 108 |
- *Error conditions:* the error conditions for error codes reported by
|
| 109 |
-
the function
|
| 110 |
-
- *Notes:* non-normative comments about the function
|
| 111 |
|
| 112 |
Whenever the *Effects:* element specifies that the semantics of some
|
| 113 |
function `F` are *Equivalent to* some code sequence, then the various
|
| 114 |
elements are interpreted as follows. If `F`’s semantics specifies a
|
| 115 |
*Requires:* element, then that requirement is logically imposed prior to
|
| 116 |
the *equivalent-to* semantics. Next, the semantics of the code sequence
|
| 117 |
-
are determined by the *Requires:* , *Effects:* , *
|
| 118 |
-
*
|
| 119 |
-
|
| 120 |
contained in the code sequence. The value returned from `F` is specified
|
| 121 |
by `F`’s *Returns:* element, or if `F` has no *Returns:* element, a
|
| 122 |
-
non-`void` return from `F` is specified by the
|
| 123 |
the code sequence. If `F`’s semantics contains a *Throws:* ,
|
| 124 |
*Postconditions:* , or *Complexity:* element, then that supersedes any
|
| 125 |
occurrences of that element in the code sequence.
|
| 126 |
|
| 127 |
For non-reserved replacement and handler functions, Clause
|
|
@@ -132,11 +131,11 @@ describes a function definition provided by the implementation. The
|
|
| 132 |
provided by either the implementation or a C++program. Where no
|
| 133 |
distinction is explicitly made in the description, the behavior
|
| 134 |
described is the required behavior.
|
| 135 |
|
| 136 |
If the formulation of a complexity requirement calls for a negative
|
| 137 |
-
number of operations, the actual requirement is zero operations.[^
|
| 138 |
|
| 139 |
Complexity requirements specified in the library clauses are upper
|
| 140 |
bounds, and implementations that provide better complexity guarantees
|
| 141 |
satisfy the requirements.
|
| 142 |
|
|
@@ -145,12 +144,11 @@ conditions are listed, together with a suitable explanation, as the
|
|
| 145 |
`enum class errc` constants ([[syserr]]).
|
| 146 |
|
| 147 |
#### C library <a id="structure.see.also">[[structure.see.also]]</a>
|
| 148 |
|
| 149 |
Paragraphs labeled “” contain cross-references to the relevant portions
|
| 150 |
-
of this International Standard and the ISO C standard
|
| 151 |
-
incorporated into this International Standard by reference.
|
| 152 |
|
| 153 |
### Other conventions <a id="conventions">[[conventions]]</a>
|
| 154 |
|
| 155 |
This subclause describes several editorial conventions used to describe
|
| 156 |
the contents of the C++standard library. These conventions are for
|
|
@@ -160,37 +158,58 @@ member functions ([[functions.within.classes]]).
|
|
| 160 |
#### Type descriptions <a id="type.descriptions">[[type.descriptions]]</a>
|
| 161 |
|
| 162 |
##### General <a id="type.descriptions.general">[[type.descriptions.general]]</a>
|
| 163 |
|
| 164 |
The Requirements subclauses may describe names that are used to specify
|
| 165 |
-
constraints on template arguments.[^
|
| 166 |
Clauses to describe the types that may be supplied as arguments by a
|
| 167 |
C++program when instantiating template components from the library.
|
| 168 |
|
| 169 |
Certain types defined in Clause [[input.output]] are used to describe
|
| 170 |
implementation-defined types. They are based on other types, but with
|
| 171 |
added constraints.
|
| 172 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
##### Enumerated types <a id="enumerated.types">[[enumerated.types]]</a>
|
| 174 |
|
| 175 |
Several types defined in Clause [[input.output]] are *enumerated
|
| 176 |
types*. Each enumerated type may be implemented as an enumeration or as
|
| 177 |
-
a synonym for an enumeration.[^
|
| 178 |
|
| 179 |
-
The enumerated type
|
| 180 |
|
| 181 |
``` cpp
|
| 182 |
-
enum enumerated {
|
| 183 |
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
.....
|
| 189 |
```
|
| 190 |
|
| 191 |
-
Here, the names
|
| 192 |
this particular enumerated type. All such elements have distinct values.
|
| 193 |
|
| 194 |
##### Bitmask types <a id="bitmask.types">[[bitmask.types]]</a>
|
| 195 |
|
| 196 |
Several types defined in Clauses [[language.support]] through
|
|
@@ -200,20 +219,19 @@ operators, as an integer type, or as a `bitset` ([[template.bitset]]).
|
|
| 200 |
|
| 201 |
The bitmask type *bitmask* can be written:
|
| 202 |
|
| 203 |
``` cpp
|
| 204 |
// For exposition only.
|
| 205 |
-
// int_type is an integral type capable of
|
| 206 |
-
// representing all values of the bitmask type.
|
| 207 |
enum bitmask : int_type {
|
| 208 |
-
|
| 209 |
};
|
| 210 |
|
| 211 |
-
constexpr bitmask
|
| 212 |
-
constexpr bitmask
|
| 213 |
-
constexpr bitmask
|
| 214 |
-
constexpr bitmask
|
| 215 |
.....
|
| 216 |
|
| 217 |
constexpr bitmask{} operator&(bitmask{} X, bitmask{} Y) {
|
| 218 |
return static_cast<bitmask{}>(
|
| 219 |
static_cast<int_type>(X) & static_cast<int_type>(Y));
|
|
@@ -238,14 +256,14 @@ bitmask{}& operator|=(bitmask{}& X, bitmask{} Y) {
|
|
| 238 |
bitmask{}& operator^=(bitmask{}& X, bitmask{} Y) {
|
| 239 |
X = X ^ Y; return X;
|
| 240 |
}
|
| 241 |
```
|
| 242 |
|
| 243 |
-
Here, the names
|
| 244 |
particular bitmask type. All such elements have distinct, nonzero values
|
| 245 |
-
such that, for any pair
|
| 246 |
-
nonzero and
|
| 247 |
represent an *empty bitmask*, in which no bitmask elements are set.
|
| 248 |
|
| 249 |
The following terms apply to objects and values of bitmask types:
|
| 250 |
|
| 251 |
- To *set* a value *Y* in an object *X* is to evaluate the expression
|
|
@@ -259,83 +277,87 @@ The following terms apply to objects and values of bitmask types:
|
|
| 259 |
|
| 260 |
The C standard library makes widespread use of characters and character
|
| 261 |
sequences that follow a few uniform conventions:
|
| 262 |
|
| 263 |
- A *letter* is any of the 26 lowercase or 26 uppercase letters in the
|
| 264 |
-
basic execution character set.
|
| 265 |
- The *decimal-point character* is the (single-byte) character used by
|
| 266 |
functions that convert between a (single-byte) character sequence and
|
| 267 |
a value of one of the floating-point types. It is used in the
|
| 268 |
character sequence to denote the beginning of a fractional part. It is
|
| 269 |
represented in Clauses [[language.support]] through [[thread]] and
|
| 270 |
Annex [[depr]] by a period, `'.'`, which is also its value in the
|
| 271 |
`"C"` locale, but may change during program execution by a call to
|
| 272 |
-
`setlocale(int, const char*)`,[^
|
| 273 |
object, as described in Clauses [[locales]] and [[input.output]].
|
| 274 |
-
- A *character sequence* is an array object ([[dcl.array]])
|
| 275 |
-
can be declared as `T A[N]`, where
|
| 276 |
`unsigned char`, or `signed char` ([[basic.fundamental]]), optionally
|
| 277 |
qualified by any combination of `const` or `volatile`. The initial
|
| 278 |
elements of the array have defined contents up to and including an
|
| 279 |
element determined by some predicate. A character sequence can be
|
| 280 |
-
designated by a pointer value
|
| 281 |
|
| 282 |
###### Byte strings <a id="byte.strings">[[byte.strings]]</a>
|
| 283 |
|
| 284 |
A *null-terminated byte string*, or NTBS, is a character sequence whose
|
| 285 |
highest-addressed element with defined content has the value zero (the
|
| 286 |
*terminating null* character); no other element in the sequence has the
|
| 287 |
-
value zero. [^
|
| 288 |
|
| 289 |
The *length* of an NTBS is the number of elements that precede the
|
| 290 |
terminating null character. An *empty* NTBS has a length of zero.
|
| 291 |
|
| 292 |
The *value* of an NTBS is the sequence of values of the elements up to
|
| 293 |
and including the terminating null character.
|
| 294 |
|
| 295 |
-
A *static* NTBS is an NTBSwith static storage duration.[^
|
| 296 |
|
| 297 |
###### Multibyte strings <a id="multibyte.strings">[[multibyte.strings]]</a>
|
| 298 |
|
| 299 |
-
A *null-terminated multibyte string
|
| 300 |
constitutes a sequence of valid multibyte characters, beginning and
|
| 301 |
-
ending in the initial shift state.[^
|
| 302 |
|
| 303 |
A *static* NTMBS is an NTMBSwith static storage duration.
|
| 304 |
|
| 305 |
#### Functions within classes <a id="functions.within.classes">[[functions.within.classes]]</a>
|
| 306 |
|
| 307 |
For the sake of exposition, Clauses [[language.support]] through
|
| 308 |
[[thread]] and Annex [[depr]] do not describe copy/move constructors,
|
| 309 |
assignment operators, or (non-virtual) destructors with the same
|
| 310 |
apparent semantics as those that can be generated by default (
|
| 311 |
-
[[class.ctor]], [[class.dtor]], [[class.copy]]).
|
|
|
|
|
|
|
|
|
|
| 312 |
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 316 |
|
| 317 |
#### Private members <a id="objects.within.classes">[[objects.within.classes]]</a>
|
| 318 |
|
| 319 |
Clauses [[language.support]] through [[thread]] and Annex [[depr]] do
|
| 320 |
not specify the representation of classes, and intentionally omit
|
| 321 |
specification of class members ([[class.mem]]). An implementation may
|
| 322 |
define static or non-static class members, or both, as needed to
|
| 323 |
implement the semantics of the member functions specified in Clauses
|
| 324 |
[[language.support]] through [[thread]] and Annex [[depr]].
|
| 325 |
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
classes. The declarations for such member objects and the definitions of
|
| 332 |
-
related member types are followed by a comment that ends with
|
| 333 |
-
*exposition only*, as in:
|
| 334 |
|
| 335 |
``` cpp
|
| 336 |
streambuf* sb; // exposition only
|
| 337 |
```
|
| 338 |
|
| 339 |
An implementation may use any technique that provides equivalent
|
| 340 |
-
|
| 341 |
|
|
|
|
| 7 |
|
| 8 |
### Structure of each clause <a id="structure">[[structure]]</a>
|
| 9 |
|
| 10 |
#### Elements <a id="structure.elements">[[structure.elements]]</a>
|
| 11 |
|
| 12 |
+
Each library clause contains the following elements, as applicable:[^1]
|
| 13 |
|
| 14 |
- Summary
|
| 15 |
- Requirements
|
| 16 |
- Detailed specifications
|
| 17 |
+
- References to the C standard library
|
| 18 |
|
| 19 |
#### Summary <a id="structure.summary">[[structure.summary]]</a>
|
| 20 |
|
| 21 |
The Summary provides a synopsis of the category, and introduces the
|
| 22 |
first-level subclauses. Each subclause also provides a summary, listing
|
|
|
|
| 50 |
operations required of template arguments. They use a class template
|
| 51 |
`char_traits` to define these constraints.
|
| 52 |
|
| 53 |
Interface convention requirements are stated as generally as possible.
|
| 54 |
Instead of stating “class X has to define a member function
|
| 55 |
+
`operator++()`”, the interface requires “for any object `x` of class
|
| 56 |
+
`X`, `++x` is defined”. That is, whether the operator is a member is
|
| 57 |
unspecified.
|
| 58 |
|
| 59 |
Requirements are stated in terms of well-defined expressions that define
|
| 60 |
valid terms of the types that satisfy the requirements. For every set of
|
| 61 |
well-defined expression requirements there is a table that specifies an
|
|
|
|
| 68 |
[[type.descriptions]].
|
| 69 |
|
| 70 |
In some cases the semantic requirements are presented as C++code. Such
|
| 71 |
code is intended as a specification of equivalence of a construct to
|
| 72 |
another construct, not necessarily as the way the construct must be
|
| 73 |
+
implemented.[^2]
|
| 74 |
|
| 75 |
#### Detailed specifications <a id="structure.specifications">[[structure.specifications]]</a>
|
| 76 |
|
| 77 |
The detailed specifications each contain the following elements:
|
| 78 |
|
| 79 |
- name and brief description
|
| 80 |
+
- synopsis (class definition or function declaration, as appropriate)
|
| 81 |
- restrictions on template arguments, if any
|
| 82 |
- description of class invariants
|
| 83 |
- description of function semantics
|
| 84 |
|
| 85 |
Descriptions of class member functions follow the order (as
|
| 86 |
+
appropriate):[^3]
|
| 87 |
|
| 88 |
- constructor(s) and destructor
|
| 89 |
- copying, moving & assignment functions
|
| 90 |
- comparison functions
|
| 91 |
- modifier functions
|
| 92 |
- observer functions
|
| 93 |
- operators and other non-member functions
|
| 94 |
|
| 95 |
Descriptions of function semantics contain the following elements (as
|
| 96 |
+
appropriate):[^4]
|
| 97 |
|
| 98 |
- *Requires:* the preconditions for calling the function
|
| 99 |
- *Effects:* the actions performed by the function
|
| 100 |
- *Synchronization:* the synchronization operations (
|
| 101 |
[[intro.multithread]]) applicable to the function
|
|
|
|
| 104 |
- *Throws:* any exceptions thrown by the function, and the conditions
|
| 105 |
that would cause the exception
|
| 106 |
- *Complexity:* the time and/or space complexity of the function
|
| 107 |
- *Remarks:* additional semantic constraints on the function
|
| 108 |
- *Error conditions:* the error conditions for error codes reported by
|
| 109 |
+
the function
|
|
|
|
| 110 |
|
| 111 |
Whenever the *Effects:* element specifies that the semantics of some
|
| 112 |
function `F` are *Equivalent to* some code sequence, then the various
|
| 113 |
elements are interpreted as follows. If `F`’s semantics specifies a
|
| 114 |
*Requires:* element, then that requirement is logically imposed prior to
|
| 115 |
the *equivalent-to* semantics. Next, the semantics of the code sequence
|
| 116 |
+
are determined by the *Requires:* , *Effects:* , *Synchronization:* ,
|
| 117 |
+
*Postconditions:* , *Returns:* , *Throws:* , *Complexity:* , *Remarks:*
|
| 118 |
+
, and *Error conditions:* specified for the function invocations
|
| 119 |
contained in the code sequence. The value returned from `F` is specified
|
| 120 |
by `F`’s *Returns:* element, or if `F` has no *Returns:* element, a
|
| 121 |
+
non-`void` return from `F` is specified by the `return` statements in
|
| 122 |
the code sequence. If `F`’s semantics contains a *Throws:* ,
|
| 123 |
*Postconditions:* , or *Complexity:* element, then that supersedes any
|
| 124 |
occurrences of that element in the code sequence.
|
| 125 |
|
| 126 |
For non-reserved replacement and handler functions, Clause
|
|
|
|
| 131 |
provided by either the implementation or a C++program. Where no
|
| 132 |
distinction is explicitly made in the description, the behavior
|
| 133 |
described is the required behavior.
|
| 134 |
|
| 135 |
If the formulation of a complexity requirement calls for a negative
|
| 136 |
+
number of operations, the actual requirement is zero operations.[^5]
|
| 137 |
|
| 138 |
Complexity requirements specified in the library clauses are upper
|
| 139 |
bounds, and implementations that provide better complexity guarantees
|
| 140 |
satisfy the requirements.
|
| 141 |
|
|
|
|
| 144 |
`enum class errc` constants ([[syserr]]).
|
| 145 |
|
| 146 |
#### C library <a id="structure.see.also">[[structure.see.also]]</a>
|
| 147 |
|
| 148 |
Paragraphs labeled “” contain cross-references to the relevant portions
|
| 149 |
+
of this International Standard and the ISO C standard.
|
|
|
|
| 150 |
|
| 151 |
### Other conventions <a id="conventions">[[conventions]]</a>
|
| 152 |
|
| 153 |
This subclause describes several editorial conventions used to describe
|
| 154 |
the contents of the C++standard library. These conventions are for
|
|
|
|
| 158 |
#### Type descriptions <a id="type.descriptions">[[type.descriptions]]</a>
|
| 159 |
|
| 160 |
##### General <a id="type.descriptions.general">[[type.descriptions.general]]</a>
|
| 161 |
|
| 162 |
The Requirements subclauses may describe names that are used to specify
|
| 163 |
+
constraints on template arguments.[^6] These names are used in library
|
| 164 |
Clauses to describe the types that may be supplied as arguments by a
|
| 165 |
C++program when instantiating template components from the library.
|
| 166 |
|
| 167 |
Certain types defined in Clause [[input.output]] are used to describe
|
| 168 |
implementation-defined types. They are based on other types, but with
|
| 169 |
added constraints.
|
| 170 |
|
| 171 |
+
##### Exposition-only types <a id="expos.only.types">[[expos.only.types]]</a>
|
| 172 |
+
|
| 173 |
+
Several types defined in Clauses [[language.support]] through
|
| 174 |
+
[[thread]] and Annex [[depr]] that are used as function parameter or
|
| 175 |
+
return types are defined for the purpose of exposition only in order to
|
| 176 |
+
capture their language linkage. The declarations of such types are
|
| 177 |
+
followed by a comment ending in *exposition only*.
|
| 178 |
+
|
| 179 |
+
[*Example 1*:
|
| 180 |
+
|
| 181 |
+
``` cpp
|
| 182 |
+
namespace std {
|
| 183 |
+
extern "C" using some-handler = int(int, void*, double); // exposition only
|
| 184 |
+
}
|
| 185 |
+
```
|
| 186 |
+
|
| 187 |
+
The type placeholder `some-handler` can now be used to specify a
|
| 188 |
+
function that takes a callback parameter with C language linkage.
|
| 189 |
+
|
| 190 |
+
— *end example*]
|
| 191 |
+
|
| 192 |
##### Enumerated types <a id="enumerated.types">[[enumerated.types]]</a>
|
| 193 |
|
| 194 |
Several types defined in Clause [[input.output]] are *enumerated
|
| 195 |
types*. Each enumerated type may be implemented as an enumeration or as
|
| 196 |
+
a synonym for an enumeration.[^7]
|
| 197 |
|
| 198 |
+
The enumerated type `enumerated` can be written:
|
| 199 |
|
| 200 |
``` cpp
|
| 201 |
+
enum enumerated { V₀, V₁, V₂, V₃, ..... };
|
| 202 |
|
| 203 |
+
inline const enumerated C₀(V₀);
|
| 204 |
+
inline const enumerated C₁(V₁);
|
| 205 |
+
inline const enumerated C₂(V₂);
|
| 206 |
+
inline const enumerated C₃(V₃);
|
| 207 |
.....
|
| 208 |
```
|
| 209 |
|
| 210 |
+
Here, the names `C₀`, `C₁`, etc. represent *enumerated elements* for
|
| 211 |
this particular enumerated type. All such elements have distinct values.
|
| 212 |
|
| 213 |
##### Bitmask types <a id="bitmask.types">[[bitmask.types]]</a>
|
| 214 |
|
| 215 |
Several types defined in Clauses [[language.support]] through
|
|
|
|
| 219 |
|
| 220 |
The bitmask type *bitmask* can be written:
|
| 221 |
|
| 222 |
``` cpp
|
| 223 |
// For exposition only.
|
| 224 |
+
// int_type is an integral type capable of representing all values of the bitmask type.
|
|
|
|
| 225 |
enum bitmask : int_type {
|
| 226 |
+
V₀ = 1 << 0, V₁ = 1 << 1, V₂ = 1 << 2, V₃ = 1 << 3, .....
|
| 227 |
};
|
| 228 |
|
| 229 |
+
inline constexpr bitmask C₀(V₀{});
|
| 230 |
+
inline constexpr bitmask C₁(V₁{});
|
| 231 |
+
inline constexpr bitmask C₂(V₂{});
|
| 232 |
+
inline constexpr bitmask C₃(V₃{});
|
| 233 |
.....
|
| 234 |
|
| 235 |
constexpr bitmask{} operator&(bitmask{} X, bitmask{} Y) {
|
| 236 |
return static_cast<bitmask{}>(
|
| 237 |
static_cast<int_type>(X) & static_cast<int_type>(Y));
|
|
|
|
| 256 |
bitmask{}& operator^=(bitmask{}& X, bitmask{} Y) {
|
| 257 |
X = X ^ Y; return X;
|
| 258 |
}
|
| 259 |
```
|
| 260 |
|
| 261 |
+
Here, the names `C₀`, `C₁`, etc. represent *bitmask elements* for this
|
| 262 |
particular bitmask type. All such elements have distinct, nonzero values
|
| 263 |
+
such that, for any pair `Cᵢ` and `Cⱼ` where i ≠ j, `C_i & C_i` is
|
| 264 |
+
nonzero and `C_i & C_j` is zero. Additionally, the value `0` is used to
|
| 265 |
represent an *empty bitmask*, in which no bitmask elements are set.
|
| 266 |
|
| 267 |
The following terms apply to objects and values of bitmask types:
|
| 268 |
|
| 269 |
- To *set* a value *Y* in an object *X* is to evaluate the expression
|
|
|
|
| 277 |
|
| 278 |
The C standard library makes widespread use of characters and character
|
| 279 |
sequences that follow a few uniform conventions:
|
| 280 |
|
| 281 |
- A *letter* is any of the 26 lowercase or 26 uppercase letters in the
|
| 282 |
+
basic execution character set.
|
| 283 |
- The *decimal-point character* is the (single-byte) character used by
|
| 284 |
functions that convert between a (single-byte) character sequence and
|
| 285 |
a value of one of the floating-point types. It is used in the
|
| 286 |
character sequence to denote the beginning of a fractional part. It is
|
| 287 |
represented in Clauses [[language.support]] through [[thread]] and
|
| 288 |
Annex [[depr]] by a period, `'.'`, which is also its value in the
|
| 289 |
`"C"` locale, but may change during program execution by a call to
|
| 290 |
+
`setlocale(int, const char*)`,[^8] or by a change to a `locale`
|
| 291 |
object, as described in Clauses [[locales]] and [[input.output]].
|
| 292 |
+
- A *character sequence* is an array object ([[dcl.array]]) `A` that
|
| 293 |
+
can be declared as `T A[N]`, where `T` is any of the types `char`,
|
| 294 |
`unsigned char`, or `signed char` ([[basic.fundamental]]), optionally
|
| 295 |
qualified by any combination of `const` or `volatile`. The initial
|
| 296 |
elements of the array have defined contents up to and including an
|
| 297 |
element determined by some predicate. A character sequence can be
|
| 298 |
+
designated by a pointer value `S` that points to its first element.
|
| 299 |
|
| 300 |
###### Byte strings <a id="byte.strings">[[byte.strings]]</a>
|
| 301 |
|
| 302 |
A *null-terminated byte string*, or NTBS, is a character sequence whose
|
| 303 |
highest-addressed element with defined content has the value zero (the
|
| 304 |
*terminating null* character); no other element in the sequence has the
|
| 305 |
+
value zero. [^9]
|
| 306 |
|
| 307 |
The *length* of an NTBS is the number of elements that precede the
|
| 308 |
terminating null character. An *empty* NTBS has a length of zero.
|
| 309 |
|
| 310 |
The *value* of an NTBS is the sequence of values of the elements up to
|
| 311 |
and including the terminating null character.
|
| 312 |
|
| 313 |
+
A *static* NTBS is an NTBSwith static storage duration.[^10]
|
| 314 |
|
| 315 |
###### Multibyte strings <a id="multibyte.strings">[[multibyte.strings]]</a>
|
| 316 |
|
| 317 |
+
A *null-terminated multibyte string*, or NTMBS, is an NTBSthat
|
| 318 |
constitutes a sequence of valid multibyte characters, beginning and
|
| 319 |
+
ending in the initial shift state.[^11]
|
| 320 |
|
| 321 |
A *static* NTMBS is an NTMBSwith static storage duration.
|
| 322 |
|
| 323 |
#### Functions within classes <a id="functions.within.classes">[[functions.within.classes]]</a>
|
| 324 |
|
| 325 |
For the sake of exposition, Clauses [[language.support]] through
|
| 326 |
[[thread]] and Annex [[depr]] do not describe copy/move constructors,
|
| 327 |
assignment operators, or (non-virtual) destructors with the same
|
| 328 |
apparent semantics as those that can be generated by default (
|
| 329 |
+
[[class.ctor]], [[class.dtor]], [[class.copy]]). It is unspecified
|
| 330 |
+
whether the implementation provides explicit definitions for such member
|
| 331 |
+
function signatures, or for virtual destructors that can be generated by
|
| 332 |
+
default.
|
| 333 |
|
| 334 |
+
For the sake of exposition, the library clauses sometimes annotate
|
| 335 |
+
constructors with \EXPLICIT. Such a constructor is conditionally
|
| 336 |
+
declared as either explicit or non-explicit ([[class.conv.ctor]]).
|
| 337 |
+
|
| 338 |
+
[*Note 1*: This is typically implemented by declaring two such
|
| 339 |
+
constructors, of which at most one participates in overload
|
| 340 |
+
resolution. — *end note*]
|
| 341 |
|
| 342 |
#### Private members <a id="objects.within.classes">[[objects.within.classes]]</a>
|
| 343 |
|
| 344 |
Clauses [[language.support]] through [[thread]] and Annex [[depr]] do
|
| 345 |
not specify the representation of classes, and intentionally omit
|
| 346 |
specification of class members ([[class.mem]]). An implementation may
|
| 347 |
define static or non-static class members, or both, as needed to
|
| 348 |
implement the semantics of the member functions specified in Clauses
|
| 349 |
[[language.support]] through [[thread]] and Annex [[depr]].
|
| 350 |
|
| 351 |
+
For the sake of exposition, some subclauses provide representative
|
| 352 |
+
declarations, and semantic requirements, for private members of classes
|
| 353 |
+
that meet the external specifications of the classes. The declarations
|
| 354 |
+
for such members are followed by a comment that ends with *exposition
|
| 355 |
+
only*, as in:
|
|
|
|
|
|
|
|
|
|
| 356 |
|
| 357 |
``` cpp
|
| 358 |
streambuf* sb; // exposition only
|
| 359 |
```
|
| 360 |
|
| 361 |
An implementation may use any technique that provides equivalent
|
| 362 |
+
observable behavior.
|
| 363 |
|