istream_iterator::operator*
O operador de remoção de referência retorna o objeto armazenado do tipo Tipo endereçado por istream_iterator.
const Type& operator*( ) const;
Valor de retorno
O objeto armazenado do tipo Tipo.
Exemplo
// 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;
}
a2
FakePre-276340bcf97f451c9667c9ddcb2e4ca0-a35654310d8249058492e00f0980fcc6
Requisitos
Cabeçalho: <iterator>
Namespace: std