3 ms·
D does have zip, enumerate, cycle (https://dlang.org/phobos/std_range.html https://dlang.org/phobos/std_range.html). It doesn't have a universal collect like Ru
by nialv7 10y ago
D does have zip, enumerate, cycle (https://dlang.org/phobos/std_range.html https://dlang.org/phobos/std_range.html). It doesn't have a universal collect like Rust, but you can create arrays from ranges using array(). And if the target container/collection type is an OutputRange, you can use the put()(https://dlang.org/phobos/std_range_primitives.html#.put https://dlang.org/phobos/std_range_primitives.html#.put) function to create collections from ranges.