Condividi tramite


istreambuf_iterator::char_type

Un tipo che prevede il tipo di carattere ostreambuf_iterator.

typedef CharType char_type;

Note

Il tipo è sinonimo del parametro di template char.

Esempio

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

int main( )
{
   using namespace std;

   typedef istreambuf_iterator<char>::char_type CHT1;
   typedef istreambuf_iterator<char>::traits_type CHTR1;

   cout << "(Try the example: 'So many dots to be done'\n"
        << " then an Enter key to insert into the output,\n"
        << " & use a ctrl-Z Enter key combination to exit): ";

   // istreambuf_iterator for input stream
   istreambuf_iterator< CHT1, CHTR1> charInBuf ( cin );
   ostreambuf_iterator<char> charOut ( cout );

   // Used in conjunction with replace_copy algorithm
   // to insert into output stream and replace spaces
   // with dot-separators
   replace_copy ( charInBuf , istreambuf_iterator<char>( ),
        charOut , ' ' , '.' );
}
  Consentire a diversi punti da eseguire
  Consentire a diversi punti da eseguire
(Vedere l'esempio: “Tanti i passaggi da eseguire" quindi una chiave leave per inserire nell'output, & per utilizzare un CTRL alla z forniscono la combinazione di tasti all'uscita): Consentire a diversi punti da essere ^Z fatto di qualsiasi di So.many.dots.to.be.do

Requisiti

intestazione: <iterator>

Spazio dei nomi: deviazione standard

Vedere anche

Riferimenti

istreambuf_iterator Class

Libreria di modelli standard