On Thursday, 26 January 2017 at 11:32:09 UTC, ZombineDev wrote:
Anyway, another solution is to use refRange:

void main() {
    import std.range : refRange;
    S s;
    auto p = refRange(&s);
    foreach(i; p)
        writeln(i);
}

That way you don't need to dereference 'p' everytime you want to iterate over it. Plus, it should compose well with other range wrappers / algorithms.

This is really helpful; thanks!

Reply via email to