From Jason Turner

[syncstream.osyncstream]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpf80u9kzo/{from.md → to.md} +10 -8
tmp/tmpf80u9kzo/{from.md → to.md} RENAMED
@@ -27,11 +27,11 @@ namespace std {
27
  : basic_osyncstream(os, Allocator()) {}
28
  basic_osyncstream(basic_osyncstream&&) noexcept;
29
  ~basic_osyncstream();
30
 
31
  // assignment
32
- basic_osyncstream& operator=(basic_osyncstream&&) noexcept;
33
 
34
  // [syncstream.osyncstream.members], member functions
35
  void emit();
36
  streambuf_type* get_wrapped() const noexcept;
37
  syncbuf_type* rdbuf() const noexcept { return const_cast<syncbuf_type*>(addressof(sb)); }
@@ -40,12 +40,12 @@ namespace std {
40
  syncbuf_type sb; // exposition only
41
  };
42
  }
43
  ```
44
 
45
- `Allocator` shall meet the *Cpp17Allocator* requirements (
46
- [[cpp17.allocator]]).
47
 
48
  [*Example 1*:
49
 
50
  A named variable can be used within a block statement for streaming.
51
 
@@ -80,13 +80,13 @@ basic_osyncstream(streambuf_type* buf, const Allocator& allocator);
80
  ```
81
 
82
  *Effects:* Initializes `sb` from `buf` and `allocator`. Initializes the
83
  base class with `basic_ostream<charT, traits>(addressof(sb))`.
84
 
85
- [*Note 1*: The member functions of the provided stream buffer might be
86
- called from `emit()` while a lock is held. Care should be taken to
87
- ensure that this does not result in deadlock. — *end note*]
88
 
89
  *Ensures:* `get_wrapped() == buf` is `true`.
90
 
91
  ``` cpp
92
  basic_osyncstream(basic_osyncstream&& other) noexcept;
@@ -95,20 +95,22 @@ basic_osyncstream(basic_osyncstream&& other) noexcept;
95
  *Effects:* Move constructs the base class and `sb` from the
96
  corresponding subobjects of `other`, and calls
97
  `basic_ostream<charT, traits>::set_rdbuf(addressof(sb))`.
98
 
99
  *Ensures:* The value returned by `get_wrapped()` is the value returned
100
- by `os.get_wrapped()` prior to calling this constructor.
101
  `nullptr == other.get_wrapped()` is `true`.
102
 
103
  #### Member functions <a id="syncstream.osyncstream.members">[[syncstream.osyncstream.members]]</a>
104
 
105
  ``` cpp
106
  void emit();
107
  ```
108
 
109
- *Effects:* Calls `sb.emit()`. If that call returns `false`, calls
 
 
110
  `setstate(ios_base::badbit)`.
111
 
112
  [*Example 1*:
113
 
114
  A flush on a `basic_osyncstream` does not flush immediately:
 
27
  : basic_osyncstream(os, Allocator()) {}
28
  basic_osyncstream(basic_osyncstream&&) noexcept;
29
  ~basic_osyncstream();
30
 
31
  // assignment
32
+ basic_osyncstream& operator=(basic_osyncstream&&);
33
 
34
  // [syncstream.osyncstream.members], member functions
35
  void emit();
36
  streambuf_type* get_wrapped() const noexcept;
37
  syncbuf_type* rdbuf() const noexcept { return const_cast<syncbuf_type*>(addressof(sb)); }
 
40
  syncbuf_type sb; // exposition only
41
  };
42
  }
43
  ```
44
 
45
+ `Allocator` shall meet the *Cpp17Allocator* requirements
46
+ [[allocator.requirements.general]].
47
 
48
  [*Example 1*:
49
 
50
  A named variable can be used within a block statement for streaming.
51
 
 
80
  ```
81
 
82
  *Effects:* Initializes `sb` from `buf` and `allocator`. Initializes the
83
  base class with `basic_ostream<charT, traits>(addressof(sb))`.
84
 
85
+ [*Note 1*: The member functions of the provided stream buffer can be
86
+ called from `emit()` while a lock is held, which might result in a
87
+ deadlock if used incautiously. — *end note*]
88
 
89
  *Ensures:* `get_wrapped() == buf` is `true`.
90
 
91
  ``` cpp
92
  basic_osyncstream(basic_osyncstream&& other) noexcept;
 
95
  *Effects:* Move constructs the base class and `sb` from the
96
  corresponding subobjects of `other`, and calls
97
  `basic_ostream<charT, traits>::set_rdbuf(addressof(sb))`.
98
 
99
  *Ensures:* The value returned by `get_wrapped()` is the value returned
100
+ by `other.get_wrapped()` prior to calling this constructor.
101
  `nullptr == other.get_wrapped()` is `true`.
102
 
103
  #### Member functions <a id="syncstream.osyncstream.members">[[syncstream.osyncstream.members]]</a>
104
 
105
  ``` cpp
106
  void emit();
107
  ```
108
 
109
+ *Effects:* Behaves as an unformatted output
110
+ function [[ostream.unformatted]]. After constructing a `sentry` object,
111
+ calls `sb.emit()`. If that call returns `false`, calls
112
  `setstate(ios_base::badbit)`.
113
 
114
  [*Example 1*:
115
 
116
  A flush on a `basic_osyncstream` does not flush immediately: