Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
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 standard library. Public Function

sortUnstableContext

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

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.

Params

  • a: usize
  • b: usize
  • context

File

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