Ranges seem awkward to work with

Azi Hassan via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Sep 12 06:47:47 PDT 2017


On Tuesday, 12 September 2017 at 01:13:29 UTC, Hasen Judy wrote:
> Now, a lot of library functions seem to expect ranges as inputs 
> and return ranges as output.

Unless I'm mistaken, it was done on purpose to reduce the amount 
of memory allocations in the standard library so that it becomes 
@nogc-friendly. But yes, you can use std.array.array to turn it 
into an array, but keep in mind that it does allocate so you 
might need to watch out if you're dealing with large CSV files.


More information about the Digitalmars-d-learn mailing list