Why is std.algorithm so complicated to use?

Jacob Carlborg doob at me.com
Tue Jul 10 06:59:07 PDT 2012


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


More information about the Digitalmars-d mailing list