std::istream_iterator
De 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. |
<metanoindex/>
<tbody> </tbody>| Déclaré dans l'en-tête <iterator>
|
||
template< class T, class CharT = char, class Traits = std::char_traits<CharT>, class Distance = std::ptrdiff_t > class istream_iterator: public std::iterator<std::input_iterator_tag, T, Distance, const T*, const T&> |
||
std::istream_iterator est un itérateur d'entrée en un seul passage qui lit les objets successifs de T Type de l'objet pour lequel std::basic_istream il a été construit, en appelant le operator>> approprié. L'opération de lecture réelle est effectuée lorsque l'itérateur est incrémenté, pas quand il est déréférencé. Le premier objet peut être lu lorsque l'itérateur est construit ou lorsque le déréférencement premier pas est fait. Dans le cas contraire, le déréférencement ne renvoie une copie de l'objet le plus lu récemment .Original:
std::istream_iterator is a single-pass input iterator that reads successive objects of type T from the std::basic_istream object for which it was constructed, by calling the appropriate operator>>. The actual read operation is performed when the iterator is incremented, not when it is dereferenced. The first object may be read when the iterator is constructed or when the first dereferencing is done. Otherwise, dereferencing only returns a copy of the most recently read object.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.
La valeur par défaut construit
std::istream_iterator est connue comme la fin de flux itérateur. Quand un std::istream_iterator valide atteint la fin du flux sous-jacent, il devient égal à l'itérateur de fin de courant. Déréférencement ou l'incrémentant invoque par ailleurs un comportement indéfini .Original:
The default-constructed
std::istream_iterator is known as the end-of-stream iterator. When a valid std::istream_iterator reaches the end of the underlying stream, it becomes equal to the end-of-stream iterator. Dereferencing or incrementing it further invokes undefined behavior.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.
Une implémentation typique de
std::istream_iterator est titulaire de deux membres de données: un pointeur sur l'objet std::basic_istream associé et la valeur la plus récemment lue de type T .Original:
A typical implementation of
std::istream_iterator holds two data members: a pointer to the associated std::basic_istream object and the most recently read value of type T.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.
Lors de la lecture des caractères, std::istreambuf_iterator est plus efficace, car elle permet d'éviter la surcharge de la construction et de détruire l'objet sentinelle fois par personnage .
Original:
When reading characters, std::istreambuf_iterator is more efficient, since it avoids the overhead of constructing and destructing the sentry object once per character.
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.