On Thursday, 7 April 2016 at 13:09:22 UTC, Andrei Alexandrescu wrote:
This is a good start but we'd need a more principled attack on the problem. There are optimal sorting networks for a number of small sizes; a good start is Knuth's TAoCP Volume 3 but there's newer research as well, which needs to be investigated. A sorting network in D can be nicely done with variadic template parameters, e.g. this:

Could these fixed-length overloads be reused in the deepest recursions of existing Phobos algorithms, such as std.algorithm.sorting.sort() provided that the comparison-predicate matches.

Reply via email to