Espaces de noms
Variantes
Actions

std::ws

De cppreference.com
< cpp‎ | io‎ | manip

 
 
D'entrée / sortie de bibliothèque
I / O manipulateurs
C-style I / O
Tampons
Original:
Buffers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf
basic_filebuf
basic_stringbuf
strstreambuf (obsolète)
Cours d'eau
Original:
Streams
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Abstractions
Original:
Abstractions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ios_base
basic_ios
basic_istream
basic_ostream
basic_iostream
Fichier E / O
Original:
File I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ifstream
basic_ofstream
basic_fstream
Chaîne I / O
Original:
String I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_istringstream
basic_ostringstream
basic_stringstream
Tableau I / O
Original:
Array I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
istrstream (obsolète)
ostrstream (obsolète)
strstream (obsolète)
Types
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
streamoff
streamsize
fpos
Interface catégorie d'erreur
Original:
Error category interface
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
iostream_category (C++11)
io_errc (C++11)
 
D'entrée / sortie manipulateurs
À virgule flottante en forme
Original:
Floating-point formatting
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Formatage entier
Original:
Integer formatting
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Formatage booléen
Original:
Boolean formatting
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
boolalpha
noboolalpha
Largeur de champ et de contrôle de remplissage
Original:
Field width and fill control
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Autre mise en forme
Original:
Other formatting
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Traitement des espaces blancs
Original:
Whitespace processing
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Sortie de rinçage
Original:
Output flushing
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Indicateurs d'état manipulation
Original:
Status flags manipulation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Temps et d'argent I / O
Original:
Time and money I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
get_money (C++11)
get_time (C++11)
put_money (C++11)
put_time (C++11)
 
Déclaré dans l'en-tête <istream>
template<class CharT, class Traits >
std::basic_istream<CharT,Traits>& ws(std::basic_istream<CharT, Traits>& is );
Les rejets les espaces au début d'un flux d'entrée .
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.
Se comporte comme un UnformattedInputFunction, sauf que is.gcount() n'est pas modifié. Après la construction et la vérification de l'objet sentinelle, extrait les caractères à partir du flux et les supprime jusqu'à l'une des conditions suivantes est remplie:
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.
  • condition de fin de fichier se produit dans la séquence d'entrée (dans ce cas, la fonction appelle setstate(eofbit) mais ne définit pas failbit .
    Original:
    end of file condition occurs in the input sequence (in which case the function calls setstate(eofbit) but does not set failbit.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • l'c caractère suivant disponible dans la séquence d'entrée n'est pas déterminé par des espaces, comme std::isspace(c, is.getloc()). Le caractère non-blanc n'est pas extraite .
    Original:
    the next available character c 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.
Il s'agit d'un manipulateur d'entrée uniquement d'E / S, il peut être appelé avec une expression telle que pour tout in << std::wsin de type 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.

Sommaire

[modifier]Paramètres

is -
référence aux flux d'entrée
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.

[modifier]Retourne la valeur

is (référence au flux après l'extraction des espaces consécutifs)
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.

[modifier]Exemple

#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";}

Résultat :

ws + getline returns: "this is a test"

[modifier]Voir aussi

extraits et rejets des caractères jusqu'à ce que le caractère donné soit trouvé
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.

(fonction membre publique de std::basic_istream)[edit]
close