From Jason Turner

[ostreambuf.iterator]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpt6jf4dnz/{from.md → to.md} +10 -10
tmp/tmpt6jf4dnz/{from.md → to.md} RENAMED
@@ -1,60 +1,60 @@
1
  ### Class template `ostreambuf_iterator` <a id="ostreambuf.iterator">[[ostreambuf.iterator]]</a>
2
 
 
 
 
3
  ``` cpp
4
  namespace std {
5
  template<class charT, class traits = char_traits<charT>>
6
  class ostreambuf_iterator {
7
  public:
8
  using iterator_category = output_iterator_tag;
9
  using value_type = void;
10
- using difference_type = void;
11
  using pointer = void;
12
  using reference = void;
13
  using char_type = charT;
14
  using traits_type = traits;
15
  using streambuf_type = basic_streambuf<charT,traits>;
16
  using ostream_type = basic_ostream<charT,traits>;
17
 
 
18
  ostreambuf_iterator(ostream_type& s) noexcept;
19
  ostreambuf_iterator(streambuf_type* s) noexcept;
20
  ostreambuf_iterator& operator=(charT c);
21
 
22
  ostreambuf_iterator& operator*();
23
  ostreambuf_iterator& operator++();
24
  ostreambuf_iterator& operator++(int);
25
  bool failed() const noexcept;
26
 
27
  private:
28
- streambuf_type* sbuf_; // exposition only
29
  };
30
  }
31
  ```
32
 
33
- The class template `ostreambuf_iterator` writes successive *characters*
34
- onto the output stream from which it was constructed. It is not possible
35
- to get a character value out of the output iterator.
36
-
37
- #### `ostreambuf_iterator` constructors <a id="ostreambuf.iter.cons">[[ostreambuf.iter.cons]]</a>
38
 
39
  ``` cpp
40
  ostreambuf_iterator(ostream_type& s) noexcept;
41
  ```
42
 
43
- *Requires:* `s.rdbuf()` shall not be a null pointer.
44
 
45
  *Effects:* Initializes `sbuf_` with `s.rdbuf()`.
46
 
47
  ``` cpp
48
  ostreambuf_iterator(streambuf_type* s) noexcept;
49
  ```
50
 
51
- *Requires:* `s` shall not be a null pointer.
52
 
53
  *Effects:* Initializes `sbuf_` with `s`.
54
 
55
- #### `ostreambuf_iterator` operations <a id="ostreambuf.iter.ops">[[ostreambuf.iter.ops]]</a>
56
 
57
  ``` cpp
58
  ostreambuf_iterator& operator=(charT c);
59
  ```
60
 
 
1
  ### Class template `ostreambuf_iterator` <a id="ostreambuf.iterator">[[ostreambuf.iterator]]</a>
2
 
3
+ The class template `ostreambuf_iterator` writes successive *characters*
4
+ onto the output stream from which it was constructed.
5
+
6
  ``` cpp
7
  namespace std {
8
  template<class charT, class traits = char_traits<charT>>
9
  class ostreambuf_iterator {
10
  public:
11
  using iterator_category = output_iterator_tag;
12
  using value_type = void;
13
+ using difference_type = ptrdiff_t;
14
  using pointer = void;
15
  using reference = void;
16
  using char_type = charT;
17
  using traits_type = traits;
18
  using streambuf_type = basic_streambuf<charT,traits>;
19
  using ostream_type = basic_ostream<charT,traits>;
20
 
21
+ constexpr ostreambuf_iterator() noexcept = default;
22
  ostreambuf_iterator(ostream_type& s) noexcept;
23
  ostreambuf_iterator(streambuf_type* s) noexcept;
24
  ostreambuf_iterator& operator=(charT c);
25
 
26
  ostreambuf_iterator& operator*();
27
  ostreambuf_iterator& operator++();
28
  ostreambuf_iterator& operator++(int);
29
  bool failed() const noexcept;
30
 
31
  private:
32
+ streambuf_type* sbuf_ = nullptr; // exposition only
33
  };
34
  }
35
  ```
36
 
37
+ #### Constructors <a id="ostreambuf.iter.cons">[[ostreambuf.iter.cons]]</a>
 
 
 
 
38
 
39
  ``` cpp
40
  ostreambuf_iterator(ostream_type& s) noexcept;
41
  ```
42
 
43
+ *Preconditions:* `s.rdbuf()` is not a null pointer.
44
 
45
  *Effects:* Initializes `sbuf_` with `s.rdbuf()`.
46
 
47
  ``` cpp
48
  ostreambuf_iterator(streambuf_type* s) noexcept;
49
  ```
50
 
51
+ *Preconditions:* `s` is not a null pointer.
52
 
53
  *Effects:* Initializes `sbuf_` with `s`.
54
 
55
+ #### Operations <a id="ostreambuf.iter.ops">[[ostreambuf.iter.ops]]</a>
56
 
57
  ``` cpp
58
  ostreambuf_iterator& operator=(charT c);
59
  ```
60