[Issue 9119] Forward range addition to associative arrays.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Aug 15 12:33:55 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9119



--- Comment #3 from hsteoh at quickfur.ath.cx 2013-08-15 12:33:54 PDT ---
Using the code in the pull request, this code works:

import std.algorithm;
import std.conv;
import std.stdio: writeln;
void main () {
        int[string] aa;
        aa["a"] = 1;
        aa["b"] = 2;
        aa["c"] = 3;
        writeln(aa.byPair
                .map!((a) => "key=" ~ a.key ~ " value=" ~ to!string(a.value))
                .joiner("\n")
        );
}


The output is:

key=a value=1
key=b value=2
key=c value=3

-- 
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