Must ranges support `r1 = r2;`?

Simen Kjærås simen.kjaras at gmail.com
Sat Mar 24 22:40:39 UTC 2018


On Saturday, 24 March 2018 at 22:36:55 UTC, Simen Kjærås wrote:
> struct RefRange(R) {
>     R* innerRange;
>     this(R* innerRange) {
>         this.innerRange = innerRange;
>     }
>     void popFront() {
>         innerRange.popFront();
>     }
>     @property auto front() {
>         return innerRange.front;
>     }
>     @property bool empty() {
>         return innerRange.empty;
>     }
> }

Minor nitpick: these should of course be 
(*innerRange).popFront(), etc.

--
   Simen


More information about the Digitalmars-d mailing list