[Issue 17872] 'lazy' on variadic template parameters is ignored

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Oct 2 13:44:56 UTC 2017


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

Simen Kjaeraas <simen.kjaras at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #2 from Simen Kjaeraas <simen.kjaras at gmail.com> ---
You're right, I've misidentified the problem. This fails:

void foo(T...)(lazy T args) {
    foreach (e; args) {}
}

unittest {
    int n = 3;
    foo(n++);
    assert(n == 3);
}

Which means the problem is not in the location I thought.

--


More information about the Digitalmars-d-bugs mailing list