D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4954 - Clarify documentation of foreach with delegates.
Summary: Clarify documentation of foreach with delegates.
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dlang.org (show other issues)
Version: D2
Hardware: Other All
: P2 enhancement
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2010-09-28 14:47 UTC by Austin Hastings
Modified: 2014-09-22 13:13 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Austin Hastings 2010-09-28 14:47:38 UTC
The foreach/opApply docs acknowledge that the Aggregate in a foreach statement might be a delegate, but that section needs to be fleshed out with more text and/or an example or two:

~~~~~~~~~~
Foreach over Delegates

If Aggregate is a delegate, the type signature of the delegate is of the same as for opApply. This enables many different named looping strategies to coexist in the same class or struct.
~~~~~~~~~~
Comment 1 hsteoh 2014-09-19 21:28:09 UTC
Wow this bug is old. About time somebody did something about it!!

https://github.com/D-Programming-Language/dlang.org/pull/658
Comment 2 github-bugzilla 2014-09-22 13:13:45 UTC
Commit pushed to master at https://github.com/D-Programming-Language/dlang.org

https://github.com/D-Programming-Language/dlang.org/commit/58087a37bd3129ff11c5c2d85c6b6891bcd878ed
Merge pull request #658 from quickfur/issue4954

Add code example for foreach over delegate.