phobos recently got std.range :cache. I will evencally remove my implementation