istreambuf_iterator::operator*
O operador de remoção de referência retorna o próximo caractere no fluxo.
CharType operator*( ) const;
Valor de retorno
O próximo caractere no fluxo.
Exemplo
// istreambuf_iterator_operator_deref.cpp
// compile with: /EHsc
#include <iterator>
#include <iostream>
int main( )
{
using namespace std;
cout << "Type string of characters & enter to output it,\n"
<< " with stream buffer iterators,(try: 'I'll be back.')\n"
<< " repeat as many times as desired,\n"
<< " then keystroke ctrl-Z Enter to exit program: ";
istreambuf_iterator<char> inpos ( cin );
istreambuf_iterator<char> endpos;
ostreambuf_iterator<char> outpos ( cout );
while ( inpos != endpos )
{
*outpos = *inpos; //Put value of outpos equal to inpos
++inpos;
++outpos;
}
}
Eu de volta.
FakePre-117c84aca12b4a52b27e0ec396a15bf2-d689aea7841c4e059fe50f0a2162e421
Requisitos
Cabeçalho: <iterator>
Namespace: std