Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

sortUnstableContext

Sorts a range [a, b) using an unstable algorithm with custom context. This is a lower-level interface for sorting that works with indices instead of slices. Does not preserve relative order of equal elements.

The context must provide lessThan(a_idx, b_idx) and swap(a_idx, b_idx) methods. Uses pattern-defeating quicksort (PDQ) algorithm.

mem.sortUnstableContext
pub fn sortUnstableContext(a: usize, b: usize, context: anytype) void

File

lib/std/mem.zig:667

Code

pub fn sortUnstableContext(a: usize, b: usize, context: anytype) void {
    std.sort.pdqContext(a, b, context);
}