DoxigAlpha

MinArrayIndex

Returns the smallest of Index and usize.

Source

Implementation

#
fn MinArrayIndex(comptime Index: type) type {
    const index_info = @typeInfo(Index).int;
    assert(index_info.signedness == .unsigned);
    return if (index_info.bits >= @typeInfo(usize).int.bits) usize else Index;
}