Espacios de nombres
Variantes
Acciones

std::ostreambuf_iterator

De cppreference.com
< cpp‎ | iterator
 
 
Biblioteca de iteradores
Conceptos de iteradores
Primitivas de iteradores
Conceptos de algoritmos y servicios
Conceptos invocables indirectos
Requerimientos comunes de algoritmos
Servicios
Adaptadores de iteradores
Iteradores de flujos
ostreambuf_iterator
Puntos de personalización de iteradores
Operaciones de iteradores
(C++11)
(C++11)
Acceso a rangos
(C++11)(C++14)
(C++11)(C++14)
(C++17)(C++20)
(C++14)(C++14)
(C++14)(C++14)
(C++17)
(C++17)
 
std::ostreambuf_iterator
Las funciones miembro
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.
 
Definido en el archivo de encabezado <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 es un iterador de salida de un solo paso que escribe los caracteres sucesivos en el objeto std::basic_streambuf para la que fue construido. La operación de escritura real se lleva a cabo cuando el iterador (si desreferenciado o no) se asigna a. El incremento del std::ostreambuf_iterator es un no-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.
En una implementación típica, los miembros de datos sólo de std::ostreambuf_iterator son un puntero a la std::basic_streambuf asociado y un indicador booleano que indica si el final de la condición archivo ha sido alcanzado .
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.

Contenido

[editar] Tipos de miembros

Miembro de tipo
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>

[editar] Las funciones miembro

construye una nueva 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.

(función miembro pública)
(destructor)
(implícitamente declarado)
destructs an ostreambuf_iterator
(función miembro pública)
escribe un carácter en la secuencia de salida asociado
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.

(función miembro pública)
no-op
(función miembro pública)
no-op
(función miembro pública)
pruebas si la salida de error
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.

(función miembro pública)

Heredado de std::iterator

Member types

Miembro de tipo
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

[editar] Ejemplo

#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));
}

Salida:

This is an example

[editar] Ver también

Iterador de entrada que lee de un búfer de flujo (std::basic_streambuf).
(plantilla de clase) [editar]
Iterador de salida que escribe a un flujo de salida (std::basic_ostream).
(plantilla de clase) [editar]