istream_iterator::operator*
L'opérateur d'annulation de référence retourne l'objet stocké le type Type remédier à istream_iterator.
const Type& operator*( ) const;
Valeur de retour
L'objet stocké le type Type.
Exemple
// istream_iterator_operator.cpp
// compile with: /EHsc
#include <iterator>
#include <vector>
#include <algorithm>
#include <iostream>
int main( )
{
using namespace std;
cout << "Enter integers separated by spaces & then\n"
<< " a character ( try example: '2 4 6 8 a' ): ";
// istream_iterator from stream cin
istream_iterator<int> intRead ( cin );
// End-of-stream iterator
istream_iterator<int> EOFintRead;
while ( intRead != EOFintRead )
{
cout << "Reading: " << *intRead << endl;
++intRead;
}
cout << endl;
}
2 4 6 8 4 6 a2
FakePre-002aa20230474f71839b65f57200c46d-35022aad03ee43038cde6dd397dfa039
Configuration requise
En-tête : <iterator>
Espace de noms : std