A new WG21 paper is available. A copy is linked below, and the paper will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.
Document number: N3581
Date: 2013-03-16
Delimited iterators
by Mike Spertus
Excerpt:
It is extremely tempting to use
ostream_iteratorto, say, print avectorlike:vectorv = {1, 4, 6}; cout << "("; copy(v.begin(), v.end(), ostream_iterator (cout, ", ")); cout << ")"; // Oops! Prints (1, 4, 6, )
The problem is that the “delimiter” in the ostream_iteratorconstructor call is better described as a suffix than a delimeter.
. We offer two alternate proposals

Add a Comment
Comments are closed.