Prettier iterator implementations in D?

Bill Baxter wbaxter at gmail.com
Fri Oct 20 08:19:12 PDT 2006


David Medlock wrote:
> Bill Baxter wrote:
> 
>> Forgetting about 'foreach' for the moment, I'd like to talk about the 
>> other end of things: opApply().
>> <snip>
> 
> 
> You could always use this handy template which automatically exposes any 
> array or assoc-array in a class you want, with a single mixin.
 > [...]

Wow.  That is very cool.  D is spiffy. :-)
But I still think the core syntax should be clean.
Makes me wonder, though, if C++ had mixins like that, maybe proper 
iterators wouldn't be so hard to do correctly there either?  Just a 
matter of adding in a line:
   iteratorThis!(...)


--bb



More information about the Digitalmars-d mailing list