cpp/iterator/ostream iterator

is a single-pass that writes successive objects of type  into the std object for which it was constructed, using. Optional delimiter string is written to the output stream after every write operation. The write operation is performed when the iterator (whether dereferenced or not) is assigned to. Incrementing the is a no-op.

In a typical implementation, the only data members of are a pointer to the associated  and a pointer to the first character in the delimiter string.

When writing characters, std is more efficient, since it avoids the overhead of constructing and destructing the sentry object once per character.