xxxxxxxxxx
Lockstep!Ranges lockstep(Ranges...)(Ranges ranges)
{
return typeof(return)(ranges);
}
struct Lockstep(Ranges...)
{
private Ranges ranges;
int opApply(int delegate(int) callback)
{
import std.range : front;
for (; false;)
{
if (auto result = callback(ranges[0].front))
{
return result;
}
}
return 0;
}
int opApply(int delegate(int) pure nothrow callback) pure nothrow
{
import std.range : front;
for (; false;)
{
if (auto result = callback(ranges[0].front))
{
return result;
}
}
return 0;
}
}
static foreach (i; 0 .. 2)
unittest
{
int[] xs;
foreach (x; lockstep(xs))
{
}
}