Should range foreach be iterating over an implicit copy?

Dmitry Olshansky dmitry.olsh at gmail.com
Thu May 17 07:26:43 PDT 2012


On 17.05.2012 18:18, Steven Schveighoffer wrote:
> On Thu, 17 May 2012 01:48:06 -0400, Nick Sabalausky
> <SeeWebsiteToContactMe at semitwist.com> wrote:
>
>> I'm a little discouraged that my concern about "input ranges can't save
>> their state, and yet that's exactly what happens implicitly" hasn't been
>> addressed. I was hoping to at least get a "That's not really a problem
>> and
>> here's why..."
>
> input ranges can save their state if they are also forward ranges.
>

s/ save state / copy themselves
Fixed :)
That's why I tried to come up with BacktrackRange or some such. An input 
range that you can "shake" to reset to some saved point, but can't have 
two separate states at _the same time_ (nor full copy, it's like ... file)



-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list