I've ran into the problem with Random, there are some bugs entered by bearophile. Since then they added http://dlang.org/phobos/std_range.html#RefRange but I haven't used it to see how well it solves the problem.