Bug 320 – Delegates should be allowed as foreach aggregates

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2006-09-02T22:24:00Z
Last change time
2015-06-09T05:14:44Z
Assigned to
bugzilla
Creator
ibisbasenji

Comments

Comment #0 by ibisbasenji — 2006-09-02T22:24:23Z
Seeing as how foreach works on objects by calling a method with a certain signature, it should be feasible to allow delegates with that same signature as the aggregate. This would provide a clear selective iteration concept, and with the use of delegate literals and delegates to nested functions, could possibly lead to a number of new design patterns.
Comment #1 by braddr — 2006-10-18T12:15:07Z
Added in 0.170