Bug 24176 – Parameters of opApply delegate don't have to be `ref`

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dlang.org
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2023-10-06T12:26:34Z
Last change time
2023-11-08T10:33:34Z
Keywords
pull, spec
Assigned to
No Owner
Creator
Nick Treleaven

Comments

Comment #0 by nick — 2023-10-06T12:26:34Z
The spec should be clearer on that. Also a `ref` parameter of the delegate can accept non-ref foreach variables. PR incoming.
Comment #1 by dlang-bot — 2023-10-06T12:29:00Z
@ntrel created dlang/dlang.org pull request #3699 "[spec] Improve `opApply` docs" fixing this issue: - [spec] Improve `opApply` docs Show grammar for signature. Don't require `ref` delegate parameter. Explain non-ref ForeachType can match a ref OpApplyParameter. Fixes Issue 24176 - Parameters of opApply delegate don't have to be `ref`. https://github.com/dlang/dlang.org/pull/3699
Comment #2 by dlang-bot — 2023-11-08T10:33:34Z
dlang/dlang.org pull request #3699 "[spec] Improve `opApply` docs" was merged into master: - ec20daf236f6b685c51b629430f554abf4c2fceb by Nick Treleaven: [spec] Improve `opApply` docs Show grammar for signature. Don't require `ref` delegate parameter. Explain non-ref ForeachType can match a ref OpApplyParameter. Fixes Issue 24176 - Parameters of opApply delegate don't have to be `ref`. https://github.com/dlang/dlang.org/pull/3699