istream_iterator::operator->
Retourne la valeur d'un membre, le cas échéant.
const Type* operator->( ) const;
Valeur de retour
la valeur d'un membre, s'il y en a.
Notes
i -> équivaut à (*i).m
L'opérateur retourne &**ceci.
Exemple
// istream_iterator_operator_vm.cpp
// compile with: /EHsc
#include <iterator>
#include <iostream>
#include <complex>
using namespace std;
int main( )
{
cout << "Enter complex numbers separated by spaces & then\n"
<< " a character pair ( try example: '(1,2) (3,4) (a,b)' ): ";
// istream_iterator from stream cin
istream_iterator< complex<double> > intRead ( cin );
// End-of-stream iterator
istream_iterator<complex<double> > EOFintRead;
while ( intRead != EOFintRead )
{
cout << "Reading the real part: " << intRead ->real( ) << endl;
cout << "Reading the imaginary part: " << intRead ->imag( ) << endl;
++intRead;
}
cout << endl;
}
(1,2) (3,4) (a,b)
FakePre-72d0dbaad6864970a415f25c1bd31df1-21778d3754f847b4bb398ba0c74b8ca0
Configuration requise
En-tête : <iterator>
Espace de noms : std