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 standard library.
std › bit_set › GenericIterator › init Private Function init Doc Source Private Function std.bit_set.GenericIterator.init
fn init (masks : []const MaskInt , last_word_mask : MaskInt ) Self Params masks : []const MaskInt last_word_mask : MaskInt File bit_set.zig: 1286
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304 fn init (masks : []const MaskInt , last_word_mask : MaskInt ) Self {
if (masks .len == 0 ) {
return Self {
.bits_remain = 0 ,
.words_remain = &[_ ]MaskInt {},
.last_word_mask = last_word_mask ,
.bit_offset = 0 ,
};
} else {
var result = Self {
.bits_remain = 0 ,
.words_remain = masks ,
.last_word_mask = last_word_mask ,
.bit_offset = if (direction == .forward ) 0 else (masks .len - 1 ) * @bitSizeOf (MaskInt ),
};
result .nextWord (true );
return result ;
}
}