Espacios de nombres
Variantes
Acciones

std::ostream_iterator::ostream_iterator

De cppreference.com

 
 
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.
iterator_traits
input_iterator_tag
output_iterator_tag
forward_iterator_tag
bidirectional_iterator_tag
random_access_iterator_tag
iterator
Adaptadores 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.
reverse_iterator
Iteradores Stream
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.
istream_iterator
ostream_iterator
istreambuf_iterator
ostreambuf_iterator
Operaciones 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.
advance
distance
prev(C++11)
next(C++11)
Rango de acceso
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.
begin(C++11)
end(C++11)
 
std::ostream_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.
ostream_iterator::ostream_iterator
ostream_iterator::~ostream_iterator
ostream_iterator::operator=
ostream_iterator::operator*
ostream_iterator::operator++
ostream_iterator::operator++(int)
 
ostream_iterator(ostream_type& buffer, const CharT* delim)
(1)
ostream_iterator(ostream_type& stream)
(2)

1) Constructs the iterator with the private ostream_type* member initialized with &stream and the private delimiter pointer initialized with delim.

2) Constructs the iterator with the private ostream_type* member initialized with &stream and the private delimiter pointer initialized with null pointer value.

[editar] Parámetros

stream - the output stream to be accessed by this iterator
delim - the null-terminated character string to be inserted into the stream after each output

[editar] Ejemplo

#include <iostream>
#include <iterator>
#include <algorithm>
int main()
{
    std::ostream_iterator<int> i1(std::cout, ", ");
    std::fill_n(i1, 5, -1);
    std::ostream_iterator<double> i2(std::cout);
    *i2++ = 3.14;
}

Output:

-1, -1, -1, -1, -1, 3.14