Implementing Iterator to support foreach

Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Apr 7 23:12:10 PDT 2015


On 04/07/2015 10:59 PM, tcak wrote:
> I am planning to implement "Iterator" class. But looking at "foreach"
> statement, it takes a range only.

The other option is to overload opApply():

 
http://ddili.org/ders/d.en/foreach_opapply.html#ix_foreach_opapply.opApply

Ali



More information about the Digitalmars-d-learn mailing list