File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change 330
330
\end {codeblock }
331
331
\end {example }
332
332
333
+ \rSec 2[diff.cpp23.io]{\ref {input.output }: input/output library}
334
+
335
+ \diffref {istream.unformatted }
336
+ \change
337
+ Overloaded \tcode {std::basic_istream<char, traits>::ignore}.
338
+ \rationale
339
+ Allow \tcode {char} values to be used as delimiters.
340
+ \effect
341
+ Calls to \tcode {istream::ignore} with a second argument of \tcode {char} type
342
+ can change behavior.
343
+ Calls to \tcode {istream::ignore} with a second argument that is neither
344
+ \tcode {int} nor \tcode {char} type can become ill-formed.
345
+ \begin {example }
346
+ \begin {codeblock }
347
+ std::istringstream in("\xF 0\x 9F\xA 4\xA 1 Clown Face");
348
+ in.ignore(100, '\xA1' ); // ignore up to \tcode {'\textbackslash {}xA1'} delimiter,
349
+ // previously might have ignored to EOF
350
+ in.ignore(100, -1L); // ambiguous overload,
351
+ // previously equivalent to \tcode {(int)-1L}
352
+ \end {codeblock }
353
+ \end {example }
354
+
333
355
\rSec 2[diff.cpp23.depr]{\ref {depr }: compatibility features}
334
356
335
357
\nodiffref
Original file line number Diff line number Diff line change 4363
4363
basic_istream& getline(char_type* s, streamsize n, char_type delim);
4364
4364
4365
4365
basic_istream& ignore(streamsize n = 1, int_type delim = traits::eof());
4366
+ basic_istream& ignore(streamsize n, char_type delim);
4366
4367
int_type peek();
4367
4368
basic_istream& read (char_type* s, streamsize n);
4368
4369
streamsize readsome(char_type* s, streamsize n);
5426
5427
\tcode{*this}.
5427
5428
\end{itemdescr}
5428
5429
5430
+ \indexlibrarymember{ignore}{basic_istream}%
5431
+ \begin{itemdecl}
5432
+ basic_istream& ignore(streamsize n, char_type delim);
5433
+ \end{itemdecl}
5434
+
5435
+ \begin{itemdescr}
5436
+ \pnum
5437
+ \constraints
5438
+ \tcode{is_same_v<char_type, char>} is \tcode{true}.
5439
+
5440
+ \pnum
5441
+ \effects
5442
+ Equivalent to: \tcode{return ignore(n, traits::to_int_type(delim));}
5443
+ \end{itemdescr}
5444
+
5429
5445
\indexlibrarymember{peek}{basic_istream}%
5430
5446
\begin{itemdecl}
5431
5447
int_type peek();
You can’t perform that action at this time.
0 commit comments