Continue iteration after exception

monarch_dodra monarchdodra at gmail.com
Wed Jan 23 07:52:25 PST 2013


On Wednesday, 23 January 2013 at 15:24:02 UTC, Josh wrote:
> On Wednesday, 23 January 2013 at 15:00:16 UTC, bearophile wrote:
>> A possible solution: desugar the foreach range iteration 
>> protocol of dirEntries and wrap the relevant method with a 
>> try-catch.
>
> Sorry, could you explain that a little? I'm not sure what 
> desugar means :/

He means you turn it into a normal loop with !empty, front and 
popFront.

That wouldn't really work anyways. Why you'd be able to catch the 
exception when calling popFront, and preserve your iteration 
state, you'd be unable to iterate past the exception point :/


More information about the Digitalmars-d-learn mailing list