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 › testSubsetOf Private Function testSubsetOf Doc Source Private Function std.bit_set.testSubsetOf
fn testSubsetOf (empty : anytype , full : anytype , even : anytype , odd : anytype , len : usize ) !void Params empty full even odd len : usize File bit_set.zig: 1390
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408 fn testSubsetOf (empty : anytype , full : anytype , even : anytype , odd : anytype , len : usize ) !void {
try testing .expect (empty .subsetOf (empty ));
try testing .expect (empty .subsetOf (full ));
try testing .expect (full .subsetOf (full ));
switch (len ) {
0 => {
try testing .expect (even .subsetOf (odd ));
try testing .expect (odd .subsetOf (even ));
},
1 => {
try testing .expect (!even .subsetOf (odd ));
try testing .expect (odd .subsetOf (even ));
},
else => {
try testing .expect (!even .subsetOf (odd ));
try testing .expect (!odd .subsetOf (even ));
},
}
}