On Tuesday, 28 January 2014 at 14:46:48 UTC, Gary Willoughby wrote:
Using std.algorithm how to uniq and sort a multidimensional array?

e.g. the uniq function takes a function as a predicate but i'm confused how to handle the multiple dimensions.

    string[][] tags;

    tags = tags.uniq!("a[0][1] == b[1][1]").array;

The above is my attempt and it failed.

Gah, it was simpler than i thought, of course.

        tags = tags.sort!("a[1] < b[1]").uniq!("a[1] == b[1]").array;

Reply via email to