Created
September 19, 2014 12:17
-
-
Save sinkuu/6e71c9abbb3608cc8886 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
import std.range; | |
void main() | |
{ | |
auto nums = iota(1, 6); | |
static if (false) | |
{ | |
// works | |
auto r1 = refRange(&nums).filter!(i => i < 4); | |
} | |
else | |
{ | |
// not works | |
auto r1 = refRange(&nums).until(4); | |
} | |
auto s1 = r1.save; | |
r1.popFront(); | |
assert(s1.front == 1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment