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 › Target › kvx › all_features Public Constant all_features Doc Source Public Constant std.Target.kvx.all_features
pub const all_features = blk : File Target/kvx.zig: 18
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47 pub const all_features = blk : {
const len = @typeInfo (Feature ).@"enum" .field_names .len ;
std .debug .assert (len <= CpuFeature .Set .needed_bit_count );
var result : [len ]CpuFeature = undefined ;
result [@backingInt (Feature .v3_1 )] = .{
.llvm_name = null ,
.description = "Enable ISA v3.1" ,
.dependencies = featureSet (&[_ ]Feature {}),
};
result [@backingInt (Feature .v3_2 )] = .{
.llvm_name = null ,
.description = "Enable ISA v3.2" ,
.dependencies = featureSet (&[_ ]Feature {
.v3_1 ,
}),
};
result [@backingInt (Feature .v4_1 )] = .{
.llvm_name = null ,
.description = "Enable ISA v4.1" ,
.dependencies = featureSet (&[_ ]Feature {
.v3_2 ,
}),
};
const ti = @typeInfo (Feature );
for (&result , 0 ..) |*elem , i | {
elem .index = i ;
elem .name = ti .@"enum" .field_names [i ];
}
break :blk result ;
}