BidirectionalRange switching direction

Tofu Ninja via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Sep 22 19:10:20 PDT 2015


Trying to implement a bi directional range and it is slightly 
unclear what the semantics are supposed to be and just wanted 
some clarification.

Are bidirectional ranges supposed to be able to support switching 
direction mid iteration? Like if I do popFront popFront popBack 
should that be equal to just a single popFront? Or once you start 
on a direction should switching be considered an error? Or is 
popFront and popBack supposed to consume from both ends of the 
range and the range is empty when they meet?

-tofu



More information about the Digitalmars-d-learn mailing list