[Issue 15290] length of associative array literal with duplicate keys is wrong

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Feb 2 23:18:45 PST 2017


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

Ivan Kazmenko <gassa at mail.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gassa at mail.ru

--- Comment #1 from Ivan Kazmenko <gassa at mail.ru> ---
Stumbled across this one, too:
https://forum.dlang.org/post/choxsofkhspvmpbyggco@forum.dlang.org

My use case is as follows:

foreach (i; 0..10)
    foreach (j; 0..10) if (pred2 (i, j))
        foreach (k; 0..10) if (pred3 (i, j, k))
            ... and maybe more ...
        {
            auto set = [i: true, j: true; k: true];
            if (set.length == 3)
            {
                 ... we found distinct i, j, k, ...
            }
        }

--


More information about the Digitalmars-d-bugs mailing list