getNext

Jesse Phillips jessekphillips+D at gmail.com
Mon Jul 12 21:46:51 PDT 2010


Andrei Alexandrescu Wrote:

> getNext is easy to define for e.g. arrays and files. How does it sound? 
> Does it bring significant simplification?
> 
> 
> Andrei

I'm with Jonathan on this. I don't really see much of a benefit. popFront, empty, front are very easy to define and simple to use.

Java uses getNext for its iterators. Though it calls it 'next' and throws an exception when trying to call without any elements. This leads it to also provide a hasNext function.


More information about the Digitalmars-d mailing list