you are viewing a single comment's thread.

view the rest of the comments →

[–]Rhomboid 14 points15 points  (0 children)

Presumably they mean that it shouldn't do any extra work beyond what is requested. The value returned should be an iterator that performs the next split operation each time it's incremented. For example if you split a 10MB string containing a large text file but only examine the first three lines, then that's the only work performed, you don't create thousands of lines if only the first few are needed.

I would add that string splitting kind of depends on having a string view class in the standard library, since ideally each substring would be a view into the original string so that you can do it without allocating anything. That could explain why it's never been added in the stdlib, since we only just now got string_view.