byKey and byValue: properties or methods?

bearophile bearophileHUGS at lycos.com
Tue Jan 17 10:00:31 PST 2012


Andrei Alexandrescu:

> "Iterate collection by key".

Is this code now working? (I have tried it hours ago):

import std.stdio, std.algorithm;
void main () {
    auto aa = ["a":1, "b":2];
    writeln(aa.byValue());
    writeln( map!q{ a * a }(aa.byValue()) );
}


Bye,
bearophile


More information about the Digitalmars-d mailing list