Discards leading whitespace from an input stream.
Behaves as an UnformattedInputFunction, except that is.gcount() is not modified. After constructing and checking the sentry object, extracts characters from the stream and discards them until any one of the following conditions occurs:
failbit
; this does not apply if the eofbit
is already set on is prior to the call to ws
, in which case the construction of the sentry object would set failbit
).This is an input-only I/O manipulator, it may be called with an expression such as in >> std::ws for any in of type std::basic_istream.
[edit] Parameters is - reference to input stream [edit] Return valueis (reference to the stream after extraction of consecutive whitespace).
[edit] NotesIf eofbit
is set on the stream prior to the call, the construction of the sentry object will set failbit
.
Output:
getline returns: " #1 test" ws + getline returns: "#1 test" getline returns: " #2 test" ws + getline returns: "#2 test" getline returns: "#3 test" ws + getline returns: "#3 test"[edit] Defect reports
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
DR Applied to Behavior as published Correct behavior LWG 415 C++98 callingstd::ws
might not construct the sentry
std::basic_istream<CharT,Traits>
) [edit]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4