When does take modify the underlying iterator?

ag0aep6g via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Aug 16 15:04:48 PDT 2016


On 08/16/2016 11:41 PM, ag0aep6g wrote:
> My apologies, that actually prints "[0, 1, 2, 3]" in the array case. I
> don't what's going on. That should work. Maybe I'm misunderstanding
> something about refRange.

Oh, I see. `take` is being clever. When possible, it slices the given 
range instead of popping it. Can't use `take` here then. May have to 
write a custom one that acts more predictable. Or maybe std.range.take 
can be fixed.


More information about the Digitalmars-d-learn mailing list