yat
0.20.3pre
|
#include <yat/utility/OstreamIterator.h>
Public Member Functions | |
OstreamIterator (void) | |
Default constructor. More... | |
OstreamIterator (std::ostream &os, const std::string &delimiter="") | |
Constructor. More... | |
OstreamIterator is an Output Iterator. Just like std::ostream_iterator it uses operator<<(ostream&, T)
to send formatted output to a particular ostream. While std::ostream_iterator inserts a string delimited after each element, OstreamIterator only inserts delimiter between elements.
which will give output: 2, 3, 5
|
inline |
Default constructor.
Creates an iterator that is not dereferencable.
|
inlineexplicit |
Constructor.
Creates an OstreamIterator such that assignment of t
through it is equivalent to os << delimiter << t just like std::ostream_iterator. The exception is that first time OstreamIterator is derefenced the delimiter is excluded in order to get the desired behaviour that delimiter only occurs between elements.
os | ostream to send output |
delimiter | the delimiting string |