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

next

Public Function
std.zig.Zir.UnwrappedStructDecl.FieldIterator.next
pub fn next(it: *FieldIterator) ?Field

Params

File

zig/Zir.zig:5394
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
        pub fn next(it: *FieldIterator) ?Field {
            const idx = it.next_idx;
            if (idx == it.names.len) return null;
            it.next_idx += 1;
            return .{
                .idx = idx,
                .name = it.names[idx],
                .type_body = it.body(it.type_body_lens[idx]).?,
                .align_body = it.body(if (it.align_body_lens) |l| l[idx] else 0),
                .default_body = it.body(if (it.default_body_lens) |l| l[idx] else 0),
                .is_comptime = ct: {
                    const bits = it.comptime_bits orelse break :ct false;
                    const big = bits[idx / 32];
                    const shifted = big >> @intCast(idx % 32);
                    break :ct @as(u1, @truncate(shifted)) == 1;
                },
            };
        }