On Sunday, 15 May 2016 at 15:33:24 UTC, Joseph Rushton Wakeling wrote:
I think you may have discovered a bug in `isForwardRange`


Less a bug than a subtlety, it seems.  Because of this line:
https://github.com/dlang/phobos/blob/778593d805a0c8bf39e318163e6d4004a7357904/std/range/primitives.d#L790

... the wrapper using `alias this` doesn't count as a forward range, because the result of `.save` is of the same type as the underlying RNG, rather than the wrapper itself.

The `.save` method still exists, though, although it's probably unlikely to be used in practice because `isForwardRange` evaluates to false.
  • dxorshift: random numbe... Joseph Rushton Wakeling via Digitalmars-d-announce
    • Re: dxorshift: ran... Basile B. via Digitalmars-d-announce
      • Re: dxorshift:... Joseph Rushton Wakeling via Digitalmars-d-announce
        • Re: dxorsh... Joseph Rushton Wakeling via Digitalmars-d-announce
          • Re: dx... Joseph Rushton Wakeling via Digitalmars-d-announce
            • R... Basile B. via Digitalmars-d-announce
              • ... Joseph Rushton Wakeling via Digitalmars-d-announce
                • ... Basile B. via Digitalmars-d-announce
                • ... Joseph Rushton Wakeling via Digitalmars-d-announce
                • ... Joseph Rushton Wakeling via Digitalmars-d-announce
                • ... ag0aep6g via Digitalmars-d-announce
          • Re: dx... Joseph Rushton Wakeling via Digitalmars-d-announce
            • R... jmh530 via Digitalmars-d-announce
              • ... Kagamin via Digitalmars-d-announce
              • ... Joseph Rushton Wakeling via Digitalmars-d-announce

Reply via email to