std.range: Lockstep vs. Zip

Manuel Maier via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Mar 2 00:51:07 PST 2016


Hi there,

I was wondering why I should ever prefer std.range.lockstep over 
std.range.zip. In my (very limited) tests std.range.zip offered 
the same functionality as std.range.lockstep, i.e. I was able to 
iterate using `foreach(key, value; std.range.zip(...)) {}` which, 
according to the docs, is what std.range.lockstep was supposed to 
be designed for. On top of that, std.range.zip is capable of 
producing a RandomAccessRange, but std.range.lockstep only 
produces something with opApply.

Cheers


More information about the Digitalmars-d-learn mailing list