[Issue 5502] More handy ways to create associative arrays
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Dec 9 12:24:45 PST 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5502
--- Comment #1 from bearophile_hugs at eml.cc 2012-12-09 12:24:44 PST ---
The first suggestion was implemented:
https://github.com/D-Programming-Language/phobos/compare/467db2b45d92...c850e68b0379
This works:
import std.stdio, std.array, std.algorithm;
void main() {
dchar[] s = "abaacaabbabaa"d.dup;
s.sort();
uint[dchar] aa = ['a':8, 'b':4, 'c':1];
assert(group(s).assocArray() == aa);
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list