コンパイルしてないので動くかどうか不明
module map;
auto map(FT, ATR)(FT f, ATR x)
if(isInputRange!ATR && is(typeof(f(x.front))) && !is(typeof(f(x.front)) == void))
{
static struct R
{
auto front()
{
return f(x.front);
}
void popFront()
{
x.popFront;
}
bool empty()
{
return x.empty();
}
private:
FT _f;
ART _x;
}
return R(f, x);
}