[Issue 24499] foreach over a ref parameter to an rvalue should be an error

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Aug 8 10:35:02 UTC 2025


https://issues.dlang.org/show_bug.cgi?id=24499

--- Comment #4 from Dlang Bot <dlang-bot at dlang.rocks> ---
@ntrel created dlang/dmd pull request #21674 "Deprecate `ref` for range foreach
parameter" fixing this issue:

- Deprecate `ref` for range foreach parameter

  Fix Bugzilla 24499 - foreach over a ref parameter to an rvalue should be an
error

  Allow struct variable to be `ref` to avoid destructor call on each iteration.

https://github.com/dlang/dmd/pull/21674

--


More information about the Digitalmars-d-bugs mailing list