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 330330\end {codeblock }
331331\end {example }
332332
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+
333355\rSec 2[diff.cpp23.depr]{\ref {depr }: compatibility features}
334356
335357\nodiffref
Original file line number Diff line number Diff line change 43634363 basic_istream& getline(char_type* s, streamsize n, char_type delim);
43644364
43654365 basic_istream& ignore(streamsize n = 1, int_type delim = traits::eof());
4366+ basic_istream& ignore(streamsize n, char_type delim);
43664367 int_type peek();
43674368 basic_istream& read (char_type* s, streamsize n);
43684369 streamsize readsome(char_type* s, streamsize n);
54265427\tcode{*this}.
54275428\end{itemdescr}
54285429
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+
54295445\indexlibrarymember{peek}{basic_istream}%
54305446\begin{itemdecl}
54315447int_type peek();
You can’t perform that action at this time.
0 commit comments