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. Private Function

allCpusFromDecls

Private Function
std.Target.Cpu.Arch.allCpusFromDecls
fn allCpusFromDecls(comptime cpus: type) []const *const Cpu.Model

Params

  • cpus: type

File

Target.zig:1791
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
        fn allCpusFromDecls(comptime cpus: type) []const *const Cpu.Model {
            @setEvalBranchQuota(2000);
            const decl_names = @typeInfo(cpus).@"struct".decl_names;
            var array: [decl_names.len]*const Cpu.Model = undefined;
            for (decl_names, 0..) |decl_name, i| {
                array[i] = &@field(cpus, decl_name);
            }
            const finalized = array;
            return &finalized;
        }