Implementing Iterator to support foreach

Rene Zwanenburg via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Apr 8 14:07:06 PDT 2015


On Wednesday, 8 April 2015 at 09:02:08 UTC, bearophile wrote:
> tcak:
>
>> I am planning to implement "Iterator" class. But looking at 
>> "foreach" statement, it takes a range only.
>
> Unless you are just experimenting, it's better to not go 
> against a language and its std lib.
>
> Bye,
> bearophile

Also, why do you prefer an iterator over a range?


More information about the Digitalmars-d-learn mailing list