From Jason Turner

[input.streams]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpbbczzfy9/{from.md → to.md} +23 -13
tmp/tmpbbczzfy9/{from.md → to.md} RENAMED
@@ -20,13 +20,13 @@ namespace std {
20
  template<class charT, class traits = char_traits<charT>>
21
  class basic_istream : virtual public basic_ios<charT, traits> {
22
  public:
23
  // types (inherited from basic_ios[ios])
24
  using char_type = charT;
25
- using int_type = typename traits::int_type;
26
- using pos_type = typename traits::pos_type;
27
- using off_type = typename traits::off_type;
28
  using traits_type = traits;
29
 
30
  // [istream.cons], constructor/destructor
31
  explicit basic_istream(basic_streambuf<charT, traits>* sb);
32
  virtual ~basic_istream();
@@ -67,10 +67,11 @@ namespace std {
67
 
68
  basic_istream& getline(char_type* s, streamsize n);
69
  basic_istream& getline(char_type* s, streamsize n, char_type delim);
70
 
71
  basic_istream& ignore(streamsize n = 1, int_type delim = traits::eof());
 
72
  int_type peek();
73
  basic_istream& read (char_type* s, streamsize n);
74
  streamsize readsome(char_type* s, streamsize n);
75
 
76
  basic_istream& putback(char_type c);
@@ -148,11 +149,11 @@ virtual ~basic_istream();
148
 
149
  ``` cpp
150
  basic_istream& operator=(basic_istream&& rhs);
151
  ```
152
 
153
- *Effects:* Equivalent to: `swap(rhs)`.
154
 
155
  *Returns:* `*this`.
156
 
157
  ``` cpp
158
  void swap(basic_istream& rhs);
@@ -220,12 +221,12 @@ const ctype<charT>& ctype = use_facet<ctype<charT>>(is.getloc());
220
  if (ctype.is(ctype.space, c) != 0)
221
  // c is a whitespace character.
222
  ```
223
 
224
  If, after any preparation is completed, `is.good()` is `true`,
225
- `ok_ != false` otherwise, `ok_ == false`. During preparation, the
226
- constructor may call `setstate(failbit)` (which may throw
227
  `ios_base::failure` [[iostate.flags]]).[^19]
228
 
229
  ``` cpp
230
  ~sentry();
231
  ```
@@ -234,11 +235,11 @@ constructor may call `setstate(failbit)` (which may throw
234
 
235
  ``` cpp
236
  explicit operator bool() const;
237
  ```
238
 
239
- *Returns:* `ok_`.
240
 
241
  #### Formatted input functions <a id="istream.formatted">[[istream.formatted]]</a>
242
 
243
  ##### Common requirements <a id="istream.formatted.reqmts">[[istream.formatted.reqmts]]</a>
244
 
@@ -672,11 +673,11 @@ int main() {
672
 
673
  ``` cpp
674
  basic_istream& getline(char_type* s, streamsize n);
675
  ```
676
 
677
- *Returns:* `getline(s, n, widen(’\n’))`
678
 
679
  ``` cpp
680
  basic_istream& ignore(streamsize n = 1, int_type delim = traits::eof());
681
  ```
682
 
@@ -684,11 +685,11 @@ basic_istream& ignore(streamsize n = 1, int_type delim = traits::eof());
684
  above). After constructing a `sentry` object, extracts characters and
685
  discards them. Characters are extracted until any of the following
686
  occurs:
687
 
688
  - `n != numeric_limits<streamsize>::max()` [[numeric.limits]] and `n`
689
- characters have been extracted so far
690
  - end-of-file occurs on the input sequence (in which case the function
691
  calls `setstate(eofbit)`, which may throw `ios_base::failure`
692
  [[iostate.flags]]);
693
  - `traits::eq_int_type(traits::to_int_type(c), delim)` for the next
694
  available input character `c` (in which case `c` is extracted).
@@ -696,10 +697,19 @@ occurs:
696
  [*Note 1*: The last condition will never occur if
697
  `traits::eq_int_type(delim, traits::eof())`. — *end note*]
698
 
699
  *Returns:* `*this`.
700
 
 
 
 
 
 
 
 
 
 
701
  ``` cpp
702
  int_type peek();
703
  ```
704
 
705
  *Effects:* Behaves as an unformatted input function (as described
@@ -887,13 +897,13 @@ namespace std {
887
  class basic_iostream
888
  : public basic_istream<charT, traits>,
889
  public basic_ostream<charT, traits> {
890
  public:
891
  using char_type = charT;
892
- using int_type = typename traits::int_type;
893
- using pos_type = typename traits::pos_type;
894
- using off_type = typename traits::off_type;
895
  using traits_type = traits;
896
 
897
  // [iostream.cons], constructor
898
  explicit basic_iostream(basic_streambuf<charT, traits>* sb);
899
 
@@ -948,11 +958,11 @@ virtual ~basic_iostream();
948
 
949
  ``` cpp
950
  basic_iostream& operator=(basic_iostream&& rhs);
951
  ```
952
 
953
- *Effects:* Equivalent to: `swap(rhs)`.
954
 
955
  ``` cpp
956
  void swap(basic_iostream& rhs);
957
  ```
958
 
 
20
  template<class charT, class traits = char_traits<charT>>
21
  class basic_istream : virtual public basic_ios<charT, traits> {
22
  public:
23
  // types (inherited from basic_ios[ios])
24
  using char_type = charT;
25
+ using int_type = traits::int_type;
26
+ using pos_type = traits::pos_type;
27
+ using off_type = traits::off_type;
28
  using traits_type = traits;
29
 
30
  // [istream.cons], constructor/destructor
31
  explicit basic_istream(basic_streambuf<charT, traits>* sb);
32
  virtual ~basic_istream();
 
67
 
68
  basic_istream& getline(char_type* s, streamsize n);
69
  basic_istream& getline(char_type* s, streamsize n, char_type delim);
70
 
71
  basic_istream& ignore(streamsize n = 1, int_type delim = traits::eof());
72
+ basic_istream& ignore(streamsize n, char_type delim);
73
  int_type peek();
74
  basic_istream& read (char_type* s, streamsize n);
75
  streamsize readsome(char_type* s, streamsize n);
76
 
77
  basic_istream& putback(char_type c);
 
149
 
150
  ``` cpp
151
  basic_istream& operator=(basic_istream&& rhs);
152
  ```
153
 
154
+ *Effects:* Equivalent to `swap(rhs)`.
155
 
156
  *Returns:* `*this`.
157
 
158
  ``` cpp
159
  void swap(basic_istream& rhs);
 
221
  if (ctype.is(ctype.space, c) != 0)
222
  // c is a whitespace character.
223
  ```
224
 
225
  If, after any preparation is completed, `is.good()` is `true`,
226
+ *`ok_`*` != false` otherwise, *`ok_`*` == false`. During preparation,
227
+ the constructor may call `setstate(failbit)` (which may throw
228
  `ios_base::failure` [[iostate.flags]]).[^19]
229
 
230
  ``` cpp
231
  ~sentry();
232
  ```
 
235
 
236
  ``` cpp
237
  explicit operator bool() const;
238
  ```
239
 
240
+ *Returns:* *ok\_*.
241
 
242
  #### Formatted input functions <a id="istream.formatted">[[istream.formatted]]</a>
243
 
244
  ##### Common requirements <a id="istream.formatted.reqmts">[[istream.formatted.reqmts]]</a>
245
 
 
673
 
674
  ``` cpp
675
  basic_istream& getline(char_type* s, streamsize n);
676
  ```
677
 
678
+ *Returns:* `getline(s, n, widen(’\n’))`.
679
 
680
  ``` cpp
681
  basic_istream& ignore(streamsize n = 1, int_type delim = traits::eof());
682
  ```
683
 
 
685
  above). After constructing a `sentry` object, extracts characters and
686
  discards them. Characters are extracted until any of the following
687
  occurs:
688
 
689
  - `n != numeric_limits<streamsize>::max()` [[numeric.limits]] and `n`
690
+ characters have been extracted so far;
691
  - end-of-file occurs on the input sequence (in which case the function
692
  calls `setstate(eofbit)`, which may throw `ios_base::failure`
693
  [[iostate.flags]]);
694
  - `traits::eq_int_type(traits::to_int_type(c), delim)` for the next
695
  available input character `c` (in which case `c` is extracted).
 
697
  [*Note 1*: The last condition will never occur if
698
  `traits::eq_int_type(delim, traits::eof())`. — *end note*]
699
 
700
  *Returns:* `*this`.
701
 
702
+ ``` cpp
703
+ basic_istream& ignore(streamsize n, char_type delim);
704
+ ```
705
+
706
+ *Constraints:* `is_same_v<char_type, char>` is `true`.
707
+
708
+ *Effects:* Equivalent to:
709
+ `return ignore(n, traits::to_int_type(delim));`
710
+
711
  ``` cpp
712
  int_type peek();
713
  ```
714
 
715
  *Effects:* Behaves as an unformatted input function (as described
 
897
  class basic_iostream
898
  : public basic_istream<charT, traits>,
899
  public basic_ostream<charT, traits> {
900
  public:
901
  using char_type = charT;
902
+ using int_type = traits::int_type;
903
+ using pos_type = traits::pos_type;
904
+ using off_type = traits::off_type;
905
  using traits_type = traits;
906
 
907
  // [iostream.cons], constructor
908
  explicit basic_iostream(basic_streambuf<charT, traits>* sb);
909
 
 
958
 
959
  ``` cpp
960
  basic_iostream& operator=(basic_iostream&& rhs);
961
  ```
962
 
963
+ *Effects:* Equivalent to `swap(rhs)`.
964
 
965
  ``` cpp
966
  void swap(basic_iostream& rhs);
967
  ```
968