istream_iterator::traits_type
Un tipo che prevede il tipo di tratti di carattere di istream_iterator.
typedef Traits traits_type;
Note
Il tipo è sinonimo del parametro di template Tratti.
Esempio
// istream_iterator_traits_type.cpp
// compile with: /EHsc
#include <iterator>
#include <iostream>
int main( )
{
using namespace std;
typedef istream_iterator<int>::char_type CHT1;
typedef istream_iterator<int>::traits_type CHTR1;
// Standard iterator interface for reading
// elements from the input stream:
cout << "Enter integers separated by spaces & then\n"
<< " any character ( try example: '10 20 a' ): ";
// istream_iterator for reading int stream
istream_iterator<int, CHT1, CHTR1> intRead ( cin );
// End-of-stream iterator
istream_iterator<int, CHT1, CHTR1> EOFintRead;
while ( intRead != EOFintRead )
{
cout << "Reading: " << *intRead << endl;
++intRead;
}
cout << endl;
}
10 20 a
FakePre-fda62e28ea40414c9e7e2f8406518f46-c69f4eb9668f4246ac4ea2a25fc04fda
Requisiti
Intestazione: <iteratore>
Spazio dei nomi: std