std::ws
Da cppreference.com.
![]() | Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate. La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
Elemento definito nell'header <istream> | ||
template<class CharT, class Traits > std::basic_istream<CharT,Traits>& ws(std::basic_istream<CharT, Traits>& is ); | ||
I rigetti spazi vuoti da un flusso di input.
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.
Si comporta come un
UnformattedInputFunction
, tranne che is.gcount() non viene modificato. Dopo la costruzione e la verifica dell'oggetto sentinella, estrae i caratteri dal flusso e scarta loro fino a quando una delle seguenti condizioni: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.
- condizione di fine file avviene nella sequenza di input (in questo caso la funzione chiama setstate(eofbit) ma non imposta
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.
c
il successivo carattere disponibile nella sequenza di input non è uno spazio determinato dal std::isspace(c, is.getloc()). La non-spazio bianco carattere non è estratto.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.
Questo è un ingresso solo manipolatore di I / O, può essere chiamato con espressioni quali in << std::ws per qualsiasi
in
di tipo 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.
Indice |
[modifica]Parametri
is | - | riferimento al flusso di input 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. |
[modifica]Valore di ritorno
is
(riferimento al flusso dopo l'estrazione di spazi consecutivi)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.
[modifica]Esempio
#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"
[modifica]Vedi anche
estratti e personaggi scarta fino a quando il carattere dato è stato trovato 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. (metodo pubblico) |