Re: [std-proposals] istream_iterator delimiter(s)

61 views
Skip to first unread message

David Krauss

unread,
Apr 11, 2014, 3:36:33 AM4/11/14
to std-pr...@isocpp.org

On 2014–04–11, at 3:22 PM, Jeaye Wilkerson <con...@jeaye.com> wrote:

The new second parameter (optional) for the istream_iterator constructor represents a collection of all delimiter chars. This would default to all whitespace characters.

Defaulting to all whitespace characters would mean that istream_iterator<string> would by default return only a single string before quitting. Making the argument optional would break all existing istream_iterator<string> code.

istream_iterator is not really suitable for parsing because it doesn’t have state besides the single character of putback guaranteed by streambuf.

Such a proposal might have a better chance with an implementation. You could probably achieve this by inheriting from istream_iterator. Perhaps even build a real parser around it too. It’s up to you though.

Reply all
Reply to author
Forward
0 new messages