◐ Shell
clean mode source ↗

std::ostreambuf_iterator - cppreference.com

De cppreference.com

<metanoindex/>

<tbody> </tbody>

Definido no cabeçalho

<iterator>

template< class CharT, class Traits = std::char_traits<CharT>> class ostreambuf_iterator : public std::iterator<std::output_iterator_tag, void, void, void, void>

std::ostreambuf_iterator é um iterador de saída de uma única passagem que escreve personagens sucessivos no objeto std::basic_streambuf para o qual foi construído. A operação de gravação real é executada quando o iterador (se dereferenced ou não) é atribuído. Incrementando a std::ostreambuf_iterator é um não-op.

Original:

std::ostreambuf_iterator is a single-pass output iterator that writes successive characters into the std::basic_streambuf object for which it was constructed. The actual write operation is performed when the iterator (whether dereferenced or not) is assigned to. Incrementing the std::ostreambuf_iterator is a no-op.

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Numa aplicação típica, os membros de dados somente de std::ostreambuf_iterator são um ponteiro para o std::basic_streambuf associado e um sinalizador booleano indicando se o final da condição de arquivo foi atingido.

Original:

In a typical implementation, the only data members of std::ostreambuf_iterator are a pointer to the associated std::basic_streambuf and a boolean flag indicating if the the end of file condition has been reached.

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Tipos de membro

Tipo de membro

Original:

Member type

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Definition
char_type CharT
traits_type Traits
streambuf_type std::basic_streambuf<CharT, Traits>
ostream_type std::basic_ostream<CharT, Traits>

Funções de membro

constrói um novo ostreambuf_iterator

Original:

constructs a new ostreambuf_iterator

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(função pública membro)

(destructor)

(declarada implicitamente)

destructs an ostreambuf_iterator
(função pública membro)

escreve um personagem para a seqüência de saída associada

Original:

writes a character to the associated output sequence

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(função pública membro)
no-op
(função pública membro)
no-op
(função pública membro)

testes se a saída falhou

Original:

tests if output failed

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(função pública membro)

Herdado de std::iterator

Member types

Tipo de membro

Original:

Member type

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Definition
value_type void
difference_type void
pointer void
reference void
iterator_category std::output_iterator_tag

Exemplo

#include <string>
#include <algorithm>
#include <iterator>
#include <iostream>
int main()
{
    std::string s = "This is an example\n";
    std::copy(s.begin(), s.end(), std::ostreambuf_iterator<char>(std::cout));
}

Saída:

Veja também

iterador de entrada que lê std::basic_streambuf

Original:

input iterator that reads from std::basic_streambuf

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(modelo de classe) [edit]

iterador de saída que escreve para std::basic_ostream

Original:

output iterator that writes to std::basic_ostream

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(modelo de classe) [edit]