ostream_iterator::traits_type

Un tipo que proporciona el tipo de los rasgos de caracteres del iterador.

typedef Traits traits_type;

Comentarios

el tipo es un sinónimo para el parámetro rasgosde la plantilla.

Ejemplo

// ostream_iterator_traits_type.cpp
// compile with: /EHsc
#include <iterator>
#include <vector>
#include <iostream>

int main( )
{
   using namespace std;

   // The following not OK, but are just the default values:
   typedef ostream_iterator<int>::char_type CHT1;
   typedef ostream_iterator<int>::traits_type CHTR1;

   // ostream_iterator for stream cout
   // with new line delimiter:
    ostream_iterator<int, CHT1, CHTR1> intOut ( cout , "\n" );

   // Standard iterator interface for writing
   // elements to the output stream:
   cout << "The integers written to output stream\n"
        << "by intOut are:" << endl;
   *intOut = 1;
   *intOut = 10;
   *intOut = 100;
}
  

Requisitos

encabezado: <iterador>

espacio de nombres: std

Vea también

Referencia

ostream_iterator Class

Biblioteca de plantillas estándar