std::ostream_iterator<T,CharT,Traits>::operator= (3) - Linux Manuals
std::ostream_iterator<T,CharT,Traits>::operator=: std::ostream_iterator<T,CharT,Traits>::operator=
Command to display std::ostream_iterator<T,CharT,Traits>::operator=
manual in Linux: $ man 3 std::ostream_iterator<T,CharT,Traits>::operator=
NAME
std::ostream_iterator<T,CharT,Traits>::operator= - std::ostream_iterator<T,CharT,Traits>::operator=
Synopsis
ostream_iterator& operator=( const T& value );
Inserts value into the associated stream, then inserts the delimiter, if one was specified at construction time.
If out_stream is a pointer to the associated std::basic_ostream and delim 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;
Parameters
value - the object to insert
Return value
*this
Notes
T can be any class with a user-defined operator<<
Example
// Run this code
#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;
}
Output:
1, 2, 3, 3.14
Pages related to std::ostream_iterator<T,CharT,Traits>::operator=
- std::ostream_iterator<T,CharT,Traits>::operator++ (3) - std::ostream_iterator<T,CharT,Traits>::operator++
- std::ostream_iterator<T,CharT,Traits>::ostream_iterator (3) - std::ostream_iterator<T,CharT,Traits>::ostream_iterator
- std::ostream_iterator<T,CharT,Traits>::~ostream_iterator (3) - std::ostream_iterator<T,CharT,Traits>::~ostream_iterator
- std::ostream_iterator (3) - std::ostream_iterator
- std::ostream (3) - std::basic_ostream
- std::ostreambuf_iterator (3) - std::ostreambuf_iterator
- std::ostreambuf_iterator<CharT,Traits>::failed (3) - std::ostreambuf_iterator<CharT,Traits>::failed
- std::ostreambuf_iterator<CharT,Traits>::operator++ (3) - std::ostreambuf_iterator<CharT,Traits>::operator++
- std::ostreambuf_iterator<CharT,Traits>::operator= (3) - std::ostreambuf_iterator<CharT,Traits>::operator=
- std::ostreambuf_iterator<CharT,Traits>::ostreambuf_iterator (3) - std::ostreambuf_iterator<CharT,Traits>::ostreambuf_iterator
- std::ostringstream (3) - std::basic_ostringstream
- std::ostringstream::operator= (3) - std::basic_ostringstream::operator=
- std::ostringstream::rdbuf (3) - std::basic_ostringstream::rdbuf