Fixing implicit copies of InputRanges [was: Re: Mir Random [WIP]]

Martin Nowak via Digitalmars-d digitalmars-d at puremagic.com
Fri Nov 25 22:55:24 PST 2016


On Saturday, 26 November 2016 at 06:46:19 UTC, Martin Nowak wrote:
> Maybe non-copyability needs to become a requirement for 
> InputRanges.

Could have an optional .clone if copying is supported.
What would be an InputRange where copying is correct?

> We already have refRange for that, no?
> Also refCounted(Random(unpredictableSeed)) should work.

Same scheme works for files with only plain int fds streams, 
non-copyable/unique ownership, and move, refRange, or refCounted 
for passing and sharing.

Should we split off this discussion to a dlang-study thread?


More information about the Digitalmars-d mailing list