There is a fair bit of range related code in the standard library structured like:

    auto MyRange(Range)(Range r)
        if (isInputRange!Range)
     {
        static struct Result
        {
            private Range source;
            // define empty, front, popFront, etc
        }
        return Result(r);
    }

I'm curious about what declaring the Result struct as 'static' does, and if there are use cases where it be better to exclude the static qualifier.

--Jon

Reply via email to