22.03.2013 1:13, bearophile пишет:
And in foreach:

foreach ((c, ref e); loa)


D already have undocumented[1] front tuple expansion in foreach over range:
---
import std.algorithm;
import std.stdio;

void main() {
    enum s = "this is an example for huffman encoding"d;
    foreach (c, n; s.dup.sort().release().group())
        writefln("'%s'  %s", c, n);
}
---

[1] http://d.puremagic.com/issues/show_bug.cgi?id=7361

--
Денис В. Шеломовский
Denis V. Shelomovskij

Reply via email to