std::ostreambuf_iterator::ostreambuf_iterator - cppreference.com
Espaços nominais
Variantes
Ações

std::ostreambuf_iterator::ostreambuf_iterator

De cppreference.com

<metanoindex/>

 
 
Biblioteca Iterator
Primitivas iterador
Original:
Iterator primitives
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Adaptadores de iterador
Original:
Iterator adaptors
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Iteradores fluxo
Original:
Stream iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Operações iterador
Original:
Iterator operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
(C++11)
Variar de acesso
Original:
Range access
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
(C++11)
 
std::ostreambuf_iterator
Funções de membro
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ostreambuf_iterator::ostreambuf_iterator
ostreambuf_iterator::operator=
ostreambuf_iterator::operator*
ostreambuf_iterator::operator++
ostreambuf_iterator::operator++(int)
ostreambuf_iterator::failed
 
<tbody> </tbody>
ostreambuf_iterator(streambuf_type* buffer)
(1)
ostreambuf_iterator(ostream_type& stream)
(2)

1)

Constrói o iterador com o conjunto privado streambuf_type* membro para buffer ea falha () bit a false. O comportamento é indefinido se buffer é um ponteiro nulo.
Original:
Constructs the iterator with the private streambuf_type* member set to buffer and the failed() bit set to false. The behavior is undefined if buffer is a null pointer.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

2)

Mesmo que ostreambuf_iterator(stream.rdbuf())
Original:
Same as ostreambuf_iterator(stream.rdbuf())
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Parâmetros

stream -
o fluxo de saída cuja rdbuf () irá ser acessado por este iterador
Original:
the output stream whose rdbuf() will be accessed by this iterator
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
buffer -
o buffer de fluxo de saída para ser acessado por este iterador
Original:
the output stream buffer to be accessed by this iterator
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Exceções

noexcept specification:  
<tbody> </tbody>
  (desde C++11)

Exemplo

#include <iostream>
#include <fstream>
#include <iterator>
int main()
{
    std::basic_filebuf<char> f;
    f.open("test.txt", std::ios::out);

    std::ostreambuf_iterator<char> out1(&f);

    std::ostreambuf_iterator<wchar_t> out2(std::wcout);

    *out1 = 'a';
    *out2 = L'a';
}