[Issue 13595] Extend std.algorithm.groupBy to support non-equivalence relations

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Dec 1 08:09:42 PST 2014


https://issues.dlang.org/show_bug.cgi?id=13595

--- Comment #10 from hsteoh at quickfur.ath.cx ---
Here's a somewhat reduced case:
-----
void main() {
    import std.algorithm, std.string;

    auto anags =
         ["abc", "def"]
         .map!((a) => a)
         .groupBy!((w1, w2) =>
w1.dup.representation.sort().equal(w2.dup.representation.sort()))
         ;
}
-----

Changing .map!((a) => a) to .map!((string a) => a) fixes the problem.

--


More information about the Digitalmars-d-bugs mailing list