Proposal: takeFront and takeBack

Christophe Travert travert at phare.normalesup.org
Thu Jul 5 03:27:35 PDT 2012


"monarch_dodra" , dans le message (digitalmars.D:171175), a écrit :
> For those few algorithms that work on bidirRange, we'd need a 
> garantee that they don't ever front/back the same item twice. We 
> *could* achieve this by defining a bidirectionalInputRange class 
> of range.

filter does that. If you want to call front only oncem you have to cache 
the results or... pop as you take the front value.

popFrontN and drop will crash too.


More information about the Digitalmars-d mailing list