On Thursday, 6 October 2016 at 17:22:10 UTC, Dicebot wrote:
On Thursday, 6 October 2016 at 16:56:26 UTC, Nordlöw wrote:
Is there a way to do this, or do we need something similar to
`collect` in Phobos? Something like
import std.container.array : Array;
0.iota(n).collect!Array
You mean semantics like this?
Container collect(Container, Range) (Range r)
if(isOutputRange!Container)
{
Container container;
r.copy(container);
return container;
}
Yes, along with inference of element type of the container.