Espacios de nombres
Variantes
Acciones

std::ostream_iterator::operator=

De cppreference.com
 
 
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
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::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::operator=
 
ostream_iterator& operator=( const T& value )
Inserta value en la corriente asociada, a continuación, inserta el delimitador, si se ha especificado en el momento de la construcción .
Original:
Inserts value into the associated stream, then inserts the delimiter, if one was specified at construction time.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Si out_stream es el puntero al miembro privado asociado std::basic_ostream y delim es el puntero al primer carácter del delimitador, el efecto es equivalente a
Original:
If out_stream is the private member pointer to the associated std::basic_ostream and delim is the pointer to the first character in the delimiter, the effect is equivalent to
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

*out_stream << value;
if(delim != 0)
    *out_stream << delim;
return *this;

Contenido

[editar] Parámetros

value -
el objeto a insertar
Original:
the object to insert
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Valor de retorno

*this

[editar] Notas

T puede ser cualquier clase con un operador << definida por el usuario
Original:
T can be any class with a user-defined operator<<
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Ejemplo

#include <iostream>
#include <iterator>
 
int main()
{
    std::ostream_iterator<int> i1(std::cout, ", ");
    *i1++ = 1; // usual form, used by standard algorithms
    *++i1 = 2;
    i1 = 3; // neither * nor ++ are necessary
    std::ostream_iterator<double> i2(std::cout);
    i2 = 3.14;
}

Salida:

1, 2, 3, 3.14