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

boundedOrderZ

Public Function
std.mem.boundedOrderZ
pub fn boundedOrderZ(comptime T: type, lhs: [*:0]const T, rhs: [*:0]const T, bound: usize) math.Order

Compares two many-item pointers with NUL-termination lexicographically until some specified bound.

Params

  • T: type
  • lhs: [*:0]const T
  • rhs: [*:0]const T
  • bound: usize

File

mem.zig:693
693
694
695
696
697
698
pub fn boundedOrderZ(comptime T: type, lhs: [*:0]const T, rhs: [*:0]const T, bound: usize) math.Order {
    if (lhs == rhs) return .eq;
    var i: usize = 0;
    while (lhs[i] == rhs[i] and lhs[i] != 0 and i < bound) : (i += 1) {}
    return if (i < bound) math.order(lhs[i], rhs[i]) else .eq;
}