std::ws
Aus cppreference.com
![]() |
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
definiert in Header <istream>
|
||
template< class CharT, class Traits > std::basic_istream<CharT,Traits>& ws( std::basic_istream<CharT, Traits>& is ); |
||
Verwirft führenden Leerzeichen aus einem Input-Stream .
Original:
Discards leading whitespace from an input stream.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Verhält sich als
UnformattedInputFunction
, ausgenommen is.gcount() wird nicht modifiziert. Nach dem Bau und Prüfung der Schildwache Objekts, extrahiert Zeichen aus dem Stream und verwirft sie, bis eine der folgenden Bedingungen erfüllt ist:Original:
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:The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
- Ende der Datei auftritt in der Eingangssequenz (in diesem Fall die Funktion aufruft setstate(eofbit) aber nicht gesetzt
failbit
.Original:end of file condition occurs in the input sequence (in which case the function calls setstate(eofbit) but does not setfailbit
.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
- das nächste verfügbare Zeichen
c
in der Eingabesequenz nicht Leerzeichen wie std::isspace(c, is.getloc()) bestimmt. Die Nicht-Whitespace-Zeichen nicht extrahiert .Original:the next available characterc
in the input sequence is not whitespace as determined by std::isspace(c, is.getloc()). The non-whitespace character is not extracted.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Dies ist ein Eingang-only I / O-Manipulator, kann es mit einem Ausdruck wie in << std::ws für jeden
in
des Typs aufgerufen werden std::basic_istream .Original:
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.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Inhaltsverzeichnis |
[Bearbeiten] Parameter
is | - | Verweis auf Input-Stream
Original: reference to input stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[Bearbeiten] Rückgabewert
is
(Verweis auf den Strom nach der Extraktion von aufeinander folgenden Leerzeichen)Original:
is
(reference to the stream after extraction of consecutive whitespace)The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[Bearbeiten] Beispiel
#include <iostream> #include <sstream> int main() { std::istringstream s(" this is a test"); std::string line; s >> std::ws; getline(s, line); std::cout << "ws + getline returns: \"" << line << "\"\n"; }
Output:
ws + getline returns: "this is a test"
[Bearbeiten] Siehe auch
Extrakte aus und verwirft Zeichen, bis die gegebene Zeichen gefunden wird Original: extracts and discards characters until the given character is found The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (öffentliche Elementfunktion of std::basic_istream )
|