[Issue 16362] `foreach (ref v; range)` with non-ref returning `.front()` missing dtors

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Aug 7 18:24:09 PDT 2016


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

--- Comment #1 from Ketmar Dark <ketmar at ketmar.no-ip.org> ---
Created attachment 1607
  --> https://issues.dlang.org/attachment.cgi?id=1607&action=edit
fix and test case

this patch fixes the issue by dropping `ref` from foreach args if `.front` is
function, and it doesn't return by reference.

with trivial change this patch can also be used to resolve issue 11934.

--


More information about the Digitalmars-d-bugs mailing list