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. Public Union

CpuModel

Public Union
std.Target.Query.CpuModel
pub const CpuModel = union(enum)

Fields

native: native

Always native

baseline: baseline

Always baseline

determined_by_arch_os: determined_by_arch_os

If CPU Architecture is native, then the CPU model will be native. Otherwise, it will be baseline.

explicit: *const Target.Cpu.Model

Functions

pub fn eql(a: CpuModel, b: CpuModel) bool

File

Target/Query.zig:56
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
pub const CpuModel = union(enum) {
    /// Always native
    native,

    /// Always baseline
    baseline,

    /// If CPU Architecture is native, then the CPU model will be native. Otherwise,
    /// it will be baseline.
    determined_by_arch_os,

    explicit: *const Target.Cpu.Model,

    pub fn eql(a: CpuModel, b: CpuModel) bool {
        const Tag = @typeInfo(CpuModel).@"union".tag_type.?;
        const a_tag: Tag = a;
        const b_tag: Tag = b;
        if (a_tag != b_tag) return false;
        return switch (a) {
            .native, .baseline, .determined_by_arch_os => true,
            .explicit => |a_model| a_model == b.explicit,
        };
    }
}