ostream_iterator& operator=(const ostream_iterator&); | (1) | |
ostream_iterator& operator=(const T& value); | (2) | |
| | |
1) Copy assignment operator. Assigns the contents ofother
2) Insertsvalue into the associated stream, then inserts the delimiter, if one was specified at construction time.
Ifout_stream is a pointer to the associatedstd::basic_ostream anddelim is the delimiter specified at the construction of this object, then the effect is equivalent to
*out_stream<< value;
if(delim!=0)
*out_stream<< delim;
return*this;
[edit]Parameters
| value | - | the object to insert |
[edit]Return value
*this
T can be any class with a user-definedoperator<<.
Prior to C++20, the existence of the copy assignment operator relied on thedeprecated implicit generation.
[edit]Example