From Jason Turner

[ios.base]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpd64z2zuk/{from.md → to.md} +31 -21
tmp/tmpd64z2zuk/{from.md → to.md} RENAMED
@@ -1,7 +1,9 @@
1
  ### Class `ios_base` <a id="ios.base">[[ios.base]]</a>
2
 
 
 
3
  ``` cpp
4
  namespace std {
5
  class ios_base {
6
  public:
7
  class failure; // see below
@@ -38,10 +40,11 @@ namespace std {
38
  using openmode = T3;
39
  static constexpr openmode app = unspecified;
40
  static constexpr openmode ate = unspecified;
41
  static constexpr openmode binary = unspecified;
42
  static constexpr openmode in = unspecified;
 
43
  static constexpr openmode out = unspecified;
44
  static constexpr openmode trunc = unspecified;
45
 
46
  // [ios.seekdir], seekdir
47
  using seekdir = T4;
@@ -251,15 +254,16 @@ The type `openmode` is a bitmask type [[bitmask.types]]. It contains the
251
  elements indicated in [[ios.openmode]].
252
 
253
  **Table: `openmode` effects** <a id="ios.openmode">[ios.openmode]</a>
254
 
255
  | Element | Effect(s) if set |
256
- | -------- | ----------------------------------------------------------------- |
257
  | `app` | seek to end before each write |
258
  | `ate` | open and seek to end immediately after opening |
259
  | `binary` | perform input and output in binary mode (as opposed to text mode) |
260
  | `in` | open for input |
 
261
  | `out` | open for output |
262
  | `trunc` | truncate an existing stream when opening |
263
 
264
 
265
  ##### Type `ios_base::seekdir` <a id="ios.seekdir">[[ios.seekdir]]</a>
@@ -288,10 +292,11 @@ namespace std {
288
  public:
289
  Init();
290
  Init(const Init&) = default;
291
  ~Init();
292
  Init& operator=(const Init&) = default;
 
293
  private:
294
  static int init_cnt; // exposition only
295
  };
296
  }
297
  ```
@@ -417,22 +422,22 @@ and output operations.
417
 
418
  ``` cpp
419
  static bool sync_with_stdio(bool sync = true);
420
  ```
421
 
422
- *Returns:* `true` if the previous state of the standard iostream
423
- objects [[iostream.objects]] was synchronized and otherwise returns
424
- `false`. The first time it is called, the function returns `true`.
425
-
426
  *Effects:* If any input or output operation has occurred using the
427
  standard streams prior to the call, the effect is
428
  *implementation-defined*. Otherwise, called with a `false` argument, it
429
  allows the standard streams to operate independently of the standard C
430
  streams.
431
 
432
- When a standard iostream object `str` is *synchronized* with a standard
433
- stdio stream `f`, the effect of inserting a character `c` by
 
 
 
 
434
 
435
  ``` cpp
436
  fputc(f, c);
437
  ```
438
 
@@ -466,11 +471,11 @@ is the same as the effect of
466
 
467
  ``` cpp
468
  str.rdbuf()->sputbackc(c);
469
  ```
470
 
471
- for any sequence of characters.[^6]
472
 
473
  #### Storage functions <a id="ios.base.storage">[[ios.base.storage]]</a>
474
 
475
  ``` cpp
476
  static int xalloc();
@@ -490,17 +495,20 @@ long& iword(int idx);
490
  *Effects:* If `iarray` is a null pointer, allocates an array of `long`
491
  of unspecified size and stores a pointer to its first element in
492
  `iarray`. The function then extends the array pointed at by `iarray` as
493
  necessary to include the element `iarray[idx]`. Each newly allocated
494
  element of the array is initialized to zero. The reference returned is
495
- invalid after any other operations on the object.[^7] However, the value
496
- of the storage referred to is retained, so that until the next call to
497
- `copyfmt`, calling `iword` with the same index yields another reference
498
- to the same value. If the function fails[^8] and `*this` is a base class
499
- subobject of a `basic_ios<>` object or subobject, the effect is
500
- equivalent to calling `basic_ios<>::setstate(badbit)` on the derived
501
- object (which may throw `failure`).
 
 
 
502
 
503
  *Returns:* On success `iarray[idx]`. On failure, a valid `long&`
504
  initialized to 0.
505
 
506
  ``` cpp
@@ -512,17 +520,19 @@ void*& pword(int idx);
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 allocated
516
  element of the array is initialized to a null pointer. The reference
517
- returned is invalid after any other operations on the object. However,
518
  the value of the storage referred to is retained, so that until the next
519
  call to `copyfmt`, calling `pword` with the same index yields another
520
- reference to the same value. If the function fails[^9] and `*this` is a
521
- base class subobject of a `basic_ios<>` object or subobject, the effect
522
- is equivalent to calling `basic_ios<>::setstate(badbit)` on the derived
523
- object (which may throw `failure`).
 
 
524
 
525
  *Returns:* On success `parray[idx]`. On failure a valid `void*&`
526
  initialized to 0.
527
 
528
  *Remarks:* After a subsequent call to `pword(int)` for the same object,
@@ -562,7 +572,7 @@ destroyed, whichever comes first; otherwise the behavior is undefined.
562
  ```
563
 
564
  *Effects:* Calls each registered callback pair `(fn, idx)`
565
  [[ios.base.callback]] as `(*fn)(erase_event, *this, idx)` at such time
566
  that any `ios_base` member function called from within `fn` has
567
- well-defined results.
568
 
 
1
  ### Class `ios_base` <a id="ios.base">[[ios.base]]</a>
2
 
3
+ #### General <a id="ios.base.general">[[ios.base.general]]</a>
4
+
5
  ``` cpp
6
  namespace std {
7
  class ios_base {
8
  public:
9
  class failure; // see below
 
40
  using openmode = T3;
41
  static constexpr openmode app = unspecified;
42
  static constexpr openmode ate = unspecified;
43
  static constexpr openmode binary = unspecified;
44
  static constexpr openmode in = unspecified;
45
+ static constexpr openmode noreplace = unspecified;
46
  static constexpr openmode out = unspecified;
47
  static constexpr openmode trunc = unspecified;
48
 
49
  // [ios.seekdir], seekdir
50
  using seekdir = T4;
 
254
  elements indicated in [[ios.openmode]].
255
 
256
  **Table: `openmode` effects** <a id="ios.openmode">[ios.openmode]</a>
257
 
258
  | Element | Effect(s) if set |
259
+ | ----------- | ----------------------------------------------------------------- |
260
  | `app` | seek to end before each write |
261
  | `ate` | open and seek to end immediately after opening |
262
  | `binary` | perform input and output in binary mode (as opposed to text mode) |
263
  | `in` | open for input |
264
+ | `noreplace` | open in exclusive mode |
265
  | `out` | open for output |
266
  | `trunc` | truncate an existing stream when opening |
267
 
268
 
269
  ##### Type `ios_base::seekdir` <a id="ios.seekdir">[[ios.seekdir]]</a>
 
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
  ```
 
422
 
423
  ``` cpp
424
  static bool sync_with_stdio(bool sync = true);
425
  ```
426
 
 
 
 
 
427
  *Effects:* If any input or output operation has occurred using the
428
  standard streams prior to the call, the effect is
429
  *implementation-defined*. Otherwise, called with a `false` argument, it
430
  allows the standard streams to operate independently of the standard C
431
  streams.
432
 
433
+ *Returns:* `true` if the previous state of the standard iostream
434
+ objects [[iostream.objects]] was synchronized and otherwise returns
435
+ `false`. The first time it is called, the function returns `true`.
436
+
437
+ *Remarks:* When a standard iostream object `str` is *synchronized* with
438
+ a standard stdio stream `f`, the effect of inserting a character `c` by
439
 
440
  ``` cpp
441
  fputc(f, c);
442
  ```
443
 
 
471
 
472
  ``` cpp
473
  str.rdbuf()->sputbackc(c);
474
  ```
475
 
476
+ for any sequence of characters.[^5]
477
 
478
  #### Storage functions <a id="ios.base.storage">[[ios.base.storage]]</a>
479
 
480
  ``` cpp
481
  static int xalloc();
 
495
  *Effects:* If `iarray` is a null pointer, allocates an array of `long`
496
  of unspecified size and stores a pointer to its first element in
497
  `iarray`. The function then extends the array pointed at by `iarray` as
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
504
+ another reference to the same value. If the function fails[^7]
505
+
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
 
520
  *Effects:* If `parray` is a null pointer, allocates an array of pointers
521
  to `void` of unspecified size and stores a pointer to its first element
522
  in `parray`. The function then extends the array pointed at by `parray`
523
  as necessary to include the element `parray[idx]`. Each newly allocated
524
  element of the array is initialized to a null pointer. The reference
525
+ returned is invalid after any other operation on the object. However,
526
  the value of the storage referred to is retained, so that until the next
527
  call to `copyfmt`, calling `pword` with the same index yields another
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`).
534
 
535
  *Returns:* On success `parray[idx]`. On failure a valid `void*&`
536
  initialized to 0.
537
 
538
  *Remarks:* After a subsequent call to `pword(int)` for the same object,
 
572
  ```
573
 
574
  *Effects:* Calls each registered callback pair `(fn, idx)`
575
  [[ios.base.callback]] as `(*fn)(erase_event, *this, idx)` at such time
576
  that any `ios_base` member function called from within `fn` has
577
+ well-defined results. Then, any memory obtained is deallocated.
578