foreach vs. iterators

BCS BCS at pathlink.com
Mon Nov 6 16:51:40 PST 2006


Bill Baxter wrote:
> BCS wrote:
> 
>> I have created a monster!!!
> 
> 
> Sure!  Why not?
> opApplyWith is surely no less useful than opApplyReverse. ;-)
> Oh, but we probably need opApplyWithReverse now too.  :-)
> 
> --bb


Ahh. Err. I wasn't suggesting that foreach_with() be added, it just 
looked like a good name. I could have named it "Bob" and it would still 
do what I was intending but then no one would known right off what it is 
supposed to do.

The though is that making some sort of delegate/thunk/closure as an 
iterator can provide a lot of different iteration type patterns.



More information about the Digitalmars-d-announce mailing list