Build all combinations of strings

"Nordlöw" via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jan 11 09:31:22 PST 2015


On Monday, 11 June 2012 at 19:52:38 UTC, bearophile wrote:
> Using that the code is:
>
> import std.string, std.stdio, std.array;
> void main() {
>     auto words = "foo bar doo".split();
>     auto res = permutations!false(words).map!(p => p.join(" 
> "))().array();
>     writeln(res);
> }

Is doCopy really needed as an argument here?

Couldn't this be inferred from the mutability of T instead?


More information about the Digitalmars-d-learn mailing list