d内外并行

原文

import std;

void doSomething(int i, string s)
{
    writeln("%s-%s".format(i, s));
}

void main()
{
    foreach (t; cartesianProduct(iota(1, 4), ["abc", "def", "ghi"]).parallel) {
        doSomething(t.expand);
    }
}
posted @ 2022-08-21 09:00  zjh6  阅读(20)  评论(0)    收藏  举报  来源