networkSortExactly

Sort static array x of length n using a networking sort.

  1. auto networkSortExactly(Range r)
  2. auto networkSortExactly(T[n] x)
    networkSortExactly
    (
    alias less = "a < b"
    T
    size_t n
    )
    (
    ref T[n] x
    )
    if (
    n >= 2
    )

Examples

import std.algorithm.comparison : equal;
int[4] x = [2, 3, 0, 1];
const int[4] y = [0, 1, 2, 3];
x.networkSortExactly();
assert(x[].equal(y[]));

Meta