Is this range behaviour correct?

Andrea Fontana nospam at example.com
Thu Mar 14 03:08:52 PDT 2013


I'm trying to implement a db cursor as simple InputRange. I can't 
implement as forward range because using c-api I can't clone/save 
cursor.

I wrote popFront() front() and empty() method and my range works 
fine.

Using on a foreach() it browses all elements inside range until 
range is exausthed.

If i do another foreach() it doesn't restart (empty() is called 
and it returns true, of course).

Is it the correct behaviour of a inputrange or have i missed 
something?









More information about the Digitalmars-d-learn mailing list