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 Function

init

Public Function
std.enums.BoundedEnumMultiset.init
pub fn init(init_counts: EnumFieldStruct(E, CountSize, 0)) Self

Initializes the multiset using a struct of counts.

Params

File

enums.zig:675
675
676
677
678
679
680
681
682
683
684
685
        pub fn init(init_counts: EnumFieldStruct(E, CountSize, 0)) Self {
            @setEvalBranchQuota(2 * @typeInfo(E).@"enum".field_names.len);
            var self = initWithCount(0);
            const info = @typeInfo(E).@"enum";
            inline for (info.field_names, info.field_values) |field_name, field_value| {
                const c = @field(init_counts, field_name);
                const key: E = @fromBackingInt(@intCast(field_value));
                self.counts.set(key, c);
            }
            return self;
        }