Why does std.string.splitLines return an array?

Jonathan M Davis jmdavisProg at gmx.com
Sun Oct 21 15:35:31 PDT 2012


On Sun, 2012-10-21 at 18:00 -0400, Chad J wrote:
> std.string.splitLines returns an array, which is pretty grody.  Why not 
> return a lazily-evaluated range struct so that we can avoid allocations 
> on this simple but common operation?

If you want a lazy range, then use std.algorithm.splitter. std.string
operates on and returns strings, not general ranges.

- Jonathan M Davis



More information about the Digitalmars-d mailing list