On Thursday, 11 February 2016 at 13:43:49 UTC, pineapple wrote:
Thanks! Does the map function iterate without constructing an extra list in-memory?

Yes, it is lazy, so it only calls toString when the result is actually used (by the join call).


In case you do need to create an extra list you can use array as follows:

import std.array : array;
auto result = parts.map!((part) => part.toString).array;

The call to array will "force" it to construct an array out of it.


Reply via email to