std::ostreambuf_iterator::ostreambuf_iterator
De cppreference.com
|
|
Esta página se ha traducido por ordenador/computador/computadora de la versión en inglés de la Wiki usando Google Translate.
La traducción puede contener errores y palabras aparatosas/incorrectas. Planea sobre el texto para ver la versión original. Puedes ayudar a corregir los errores y mejorar la traducción. Para instrucciones haz clic aquí. |
ostreambuf_iterator(streambuf_type* buffer) |
(1) | |
ostreambuf_iterator(ostream_type& stream) |
(2) | |
1)
Construye el repetidor con el conjunto
streambuf_type* miembro privado a buffer y la fallida () bit a false. El comportamiento no está definido si buffer es un puntero 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.
You can help to correct and verify the translation. Click here for instructions.
2)
Igual 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.
You can help to correct and verify the translation. Click here for instructions.
Parámetros
| stream | - | el flujo de salida cuyo rdbuf () se puede acceder 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 | - | el tampón de flujo de salida para acceder a 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. |
Excepciones
Ejemplo
Ejecuta este código
#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';
}