Fixing implicit copies of InputRanges [was: Re: Mir Random [WIP]]
Andrei Alexandrescu via Digitalmars-d
digitalmars-d at puremagic.com
Sat Nov 26 09:24:47 PST 2016
On 11/26/2016 01:55 AM, Martin Nowak wrote:
> 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?
Input ranges with disabled this(this) would be a major breaking change
that we probably cannot bear (and shouldn't because the gain is small).
I think an input range would be at best "pure reference" in the sense
that popFront advances all copies to the same position. -- Andrei
More information about the Digitalmars-d
mailing list