On 2012-07-10 14:50, Nick Treleaven wrote:

uniq needs sorted input:

auto r = [5, 3, 5, 6, 8].sort.uniq.map!(x => x.to!string);
writeln(r);

Tested with dmd 2.059.
I think the above should be one allocation (except for the strings).

But I want the result to be an array, which would require an additional allocation.

--
/Jacob Carlborg

Reply via email to