Is this range behaviour correct?

Ali Çehreli acehreli at yahoo.com
Thu Mar 14 14:40:34 PDT 2013


On 03/14/2013 07:29 AM, Andrea Fontana wrote:
 > On Thursday, 14 March 2013 at 13:58:56 UTC, monarch_dodra wrote:

 >> Most input ranges should model reference semantics when passed/copied
 >> by value. If somebody modifies the range, all ranges are affected. The
 >> tough part is usually preserving correct state.
 >
 > I was hoping there's something I didn't know like rewind() to 
implement :)
 >
 > Ok, I'll pray db developer to add a clone method or I'll use 
something like
 >
 > auto res = cursor.array(); if needed

I had toyed with the idea of making a ForwardRange from an InputRange by 
caching the elements. Without any guarantees, :) here is the code:

   http://forum.dlang.org/thread/ifg5ei$2qc7$1@digitalmars.com

Ali



More information about the Digitalmars-d-learn mailing list