On 05/29/2015 06:07 PM, Dennis Ritchie wrote:
Hi,
This code prints the arrays:
[5]
[6]
[7]
import std.stdio, std.algorithm;
static int idx;
Do you want to share that for the first element of every two-element
array or do you want to start from 0 for every range?
void walk(R)(R
Hi,
This code prints the arrays:
[5]
[6]
[7]
import std.stdio, std.algorithm;
static int idx;
void walk(R)(R range) {
while (!range.empty) {
range.front;
range.popFront;
++idx;
}
}
void main() {
[5, 6, 7].map!(a = [a].writeln).walk;
}
How should I apply