[Issue 14340] AssertError in std.algorithm.sorting: unstable sort fails to sort an array with a custom predicate
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sun Jul 19 17:26:45 PDT 2015
https://issues.dlang.org/show_bug.cgi?id=14340
--- Comment #4 from Ivan Kazmenko <gassa at mail.ru> ---
Have you followed the previous discussion?
Note that "count" is not just any predicate, but:
(1) a useful one,
(2) one that just requires the array to contain its elements, in any order,
whenever the predicate is evaluated,
(3) one that seems to work flawlessly in competitor languages in similar
situation.
Regarding (1), please refer to the original discussion. The link again:
http://forum.dlang.org/thread/fqbojlyocmsovrpzilhu@forum.dlang.org
This is indeed one of the easiest (yet slow) ways to express sorting by the
number of occurrences. If it is not intended to work, a way that does work
must be easy to see and somehow encouraged over this one.
--
More information about the Digitalmars-d-bugs
mailing list