Proposal: takeFront and takeBack

RivenTheMage riven-mage at id.ru
Wed Jul 4 14:56:33 PDT 2012


> The problem is that while in most cases, separating getting the
> element referred to by the iterator (or the front of the range) 
> separately
> from iterating is more efficient than having the iterator 
> return an element when
> you iterate it

Yes, but iterators don't need that separation at all. AFAIK,
that's how iterators work in Java and C++. In C# it's MoveNext()
and Current, but MoveNext() also checks for emptiness.


More information about the Digitalmars-d mailing list