-
-
Save k3kaimu/5583476 to your computer and use it in GitHub Desktop.
コンパイルしてないので動くかどうか不明
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment