xxxxxxxxxx
auto foo()
{
int high;
auto window = S();
window.map!(bs => bs.map!(bar => high));
}
struct S
{
auto front()
{
return [3];
}
}
template ElementType(R)
{
static if (is(typeof(R.front.init) T))
alias ElementType = T;
}
template map(alias fun)
{
void map(Range)(Range)
{
alias RE = ElementType!Range;
assert(!is(typeof(fun(RE.init))));
MapResult!(fun, Range) x;
}
}
int front(int[] a) { return 0; }
struct MapResult(alias fun, Range)
{
Range _input;
void front()
{
fun(_input.front);
}
}
void main() { }