tmp/tmpdq5nbbhc/{from.md → to.md}
RENAMED
|
@@ -148,11 +148,11 @@ namespace std {
|
|
| 148 |
An implementation is permitted to define `ios_base::failure` as a
|
| 149 |
synonym for a class with equivalent functionality to class
|
| 150 |
`ios_base::failure` shown in this subclause.
|
| 151 |
|
| 152 |
[*Note 1*: When `ios_base::failure` is a synonym for another type, that
|
| 153 |
-
type
|
| 154 |
injected-class-name. — *end note*]
|
| 155 |
|
| 156 |
The class `failure` defines the base class for the types of all objects
|
| 157 |
thrown as exceptions, by functions in the iostreams library, to report
|
| 158 |
errors detected during stream buffer operations.
|
|
@@ -292,27 +292,19 @@ namespace std {
|
|
| 292 |
public:
|
| 293 |
Init();
|
| 294 |
Init(const Init&) = default;
|
| 295 |
~Init();
|
| 296 |
Init& operator=(const Init&) = default;
|
| 297 |
-
|
| 298 |
-
private:
|
| 299 |
-
static int init_cnt; // exposition only
|
| 300 |
};
|
| 301 |
}
|
| 302 |
```
|
| 303 |
|
| 304 |
The class `Init` describes an object whose construction ensures the
|
| 305 |
construction of the eight objects declared in `<iostream>`
|
| 306 |
[[iostream.objects]] that associate file stream buffers with the
|
| 307 |
standard C streams provided for by the functions declared in `<cstdio>`.
|
| 308 |
|
| 309 |
-
For the sake of exposition, the maintained data is presented here as:
|
| 310 |
-
|
| 311 |
-
- `static int init_cnt`, counts the number of constructor and destructor
|
| 312 |
-
calls for class `Init`, initialized to zero.
|
| 313 |
-
|
| 314 |
``` cpp
|
| 315 |
Init();
|
| 316 |
```
|
| 317 |
|
| 318 |
*Effects:* Constructs and initializes the objects `cin`, `cout`, `cerr`,
|
|
@@ -479,25 +471,25 @@ for any sequence of characters.[^5]
|
|
| 479 |
|
| 480 |
``` cpp
|
| 481 |
static int xalloc();
|
| 482 |
```
|
| 483 |
|
| 484 |
-
*Returns:*
|
| 485 |
|
| 486 |
*Remarks:* Concurrent access to this function by multiple threads does
|
| 487 |
not result in a data race [[intro.multithread]].
|
| 488 |
|
| 489 |
``` cpp
|
| 490 |
long& iword(int idx);
|
| 491 |
```
|
| 492 |
|
| 493 |
*Preconditions:* `idx` is a value obtained by a call to `xalloc`.
|
| 494 |
|
| 495 |
-
*Effects:* If
|
| 496 |
of unspecified size and stores a pointer to its first element in
|
| 497 |
-
|
| 498 |
-
necessary to include the element `iarray[idx]`. Each newly allocated
|
| 499 |
element of the array is initialized to zero. The reference returned is
|
| 500 |
invalid after any other operation on the object.[^6]
|
| 501 |
|
| 502 |
However, the value of the storage referred to is retained, so that until
|
| 503 |
the next call to `copyfmt`, calling `iword` with the same index yields
|
|
@@ -506,28 +498,28 @@ another reference to the same value. If the function fails[^7]
|
|
| 506 |
and `*this` is a base class subobject of a `basic_ios<>` object or
|
| 507 |
subobject, the effect is equivalent to calling
|
| 508 |
`basic_ios<>::setstate(badbit)` on the derived object (which may throw
|
| 509 |
`failure`).
|
| 510 |
|
| 511 |
-
*Returns:* On success `iarray[idx]`. On failure, a valid `long&`
|
| 512 |
initialized to 0.
|
| 513 |
|
| 514 |
``` cpp
|
| 515 |
void*& pword(int idx);
|
| 516 |
```
|
| 517 |
|
| 518 |
*Preconditions:* `idx` is a value obtained by a call to `xalloc`.
|
| 519 |
|
| 520 |
-
*Effects:* If
|
| 521 |
to `void` of unspecified size and stores a pointer to its first element
|
| 522 |
-
in
|
| 523 |
-
as necessary to include the element `parray[idx]`. Each newly
|
| 524 |
-
element of the array is initialized to a null pointer. The
|
| 525 |
-
returned is invalid after any other operation on the object.
|
| 526 |
-
the value of the storage referred to is retained, so that until
|
| 527 |
-
call to `copyfmt`, calling `pword` with the same index yields
|
| 528 |
-
reference to the same value. If the function fails[^8]
|
| 529 |
|
| 530 |
and `*this` is a base class subobject of a `basic_ios<>` object or
|
| 531 |
subobject, the effect is equivalent to calling
|
| 532 |
`basic_ios<>::setstate(badbit)` on the derived object (which may throw
|
| 533 |
`failure`).
|
|
|
|
| 148 |
An implementation is permitted to define `ios_base::failure` as a
|
| 149 |
synonym for a class with equivalent functionality to class
|
| 150 |
`ios_base::failure` shown in this subclause.
|
| 151 |
|
| 152 |
[*Note 1*: When `ios_base::failure` is a synonym for another type, that
|
| 153 |
+
type needs to provide a nested type `failure` to emulate the
|
| 154 |
injected-class-name. — *end note*]
|
| 155 |
|
| 156 |
The class `failure` defines the base class for the types of all objects
|
| 157 |
thrown as exceptions, by functions in the iostreams library, to report
|
| 158 |
errors detected during stream buffer operations.
|
|
|
|
| 292 |
public:
|
| 293 |
Init();
|
| 294 |
Init(const Init&) = default;
|
| 295 |
~Init();
|
| 296 |
Init& operator=(const Init&) = default;
|
|
|
|
|
|
|
|
|
|
| 297 |
};
|
| 298 |
}
|
| 299 |
```
|
| 300 |
|
| 301 |
The class `Init` describes an object whose construction ensures the
|
| 302 |
construction of the eight objects declared in `<iostream>`
|
| 303 |
[[iostream.objects]] that associate file stream buffers with the
|
| 304 |
standard C streams provided for by the functions declared in `<cstdio>`.
|
| 305 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 306 |
``` cpp
|
| 307 |
Init();
|
| 308 |
```
|
| 309 |
|
| 310 |
*Effects:* Constructs and initializes the objects `cin`, `cout`, `cerr`,
|
|
|
|
| 471 |
|
| 472 |
``` cpp
|
| 473 |
static int xalloc();
|
| 474 |
```
|
| 475 |
|
| 476 |
+
*Returns:* *index* `++`.
|
| 477 |
|
| 478 |
*Remarks:* Concurrent access to this function by multiple threads does
|
| 479 |
not result in a data race [[intro.multithread]].
|
| 480 |
|
| 481 |
``` cpp
|
| 482 |
long& iword(int idx);
|
| 483 |
```
|
| 484 |
|
| 485 |
*Preconditions:* `idx` is a value obtained by a call to `xalloc`.
|
| 486 |
|
| 487 |
+
*Effects:* If *iarray* is a null pointer, allocates an array of `long`
|
| 488 |
of unspecified size and stores a pointer to its first element in
|
| 489 |
+
*iarray*. The function then extends the array pointed at by *iarray* as
|
| 490 |
+
necessary to include the element *`iarray`*`[idx]`. Each newly allocated
|
| 491 |
element of the array is initialized to zero. The reference returned is
|
| 492 |
invalid after any other operation on the object.[^6]
|
| 493 |
|
| 494 |
However, the value of the storage referred to is retained, so that until
|
| 495 |
the next call to `copyfmt`, calling `iword` with the same index yields
|
|
|
|
| 498 |
and `*this` is a base class subobject of a `basic_ios<>` object or
|
| 499 |
subobject, the effect is equivalent to calling
|
| 500 |
`basic_ios<>::setstate(badbit)` on the derived object (which may throw
|
| 501 |
`failure`).
|
| 502 |
|
| 503 |
+
*Returns:* On success *`iarray`*`[idx]`. On failure, a valid `long&`
|
| 504 |
initialized to 0.
|
| 505 |
|
| 506 |
``` cpp
|
| 507 |
void*& pword(int idx);
|
| 508 |
```
|
| 509 |
|
| 510 |
*Preconditions:* `idx` is a value obtained by a call to `xalloc`.
|
| 511 |
|
| 512 |
+
*Effects:* If *parray* is a null pointer, allocates an array of pointers
|
| 513 |
to `void` of unspecified size and stores a pointer to its first element
|
| 514 |
+
in *parray*. The function then extends the array pointed at by *parray*
|
| 515 |
+
as necessary to include the element *`parray`*`[idx]`. Each newly
|
| 516 |
+
allocated element of the array is initialized to a null pointer. The
|
| 517 |
+
reference returned is invalid after any other operation on the object.
|
| 518 |
+
However, the value of the storage referred to is retained, so that until
|
| 519 |
+
the next call to `copyfmt`, calling `pword` with the same index yields
|
| 520 |
+
another reference to the same value. If the function fails[^8]
|
| 521 |
|
| 522 |
and `*this` is a base class subobject of a `basic_ios<>` object or
|
| 523 |
subobject, the effect is equivalent to calling
|
| 524 |
`basic_ios<>::setstate(badbit)` on the derived object (which may throw
|
| 525 |
`failure`).
|