Skip to content

zigar.function.GeneratorArgOf(function)

Chung Leong edited this page May 30, 2025 · 3 revisions

Return the first generator type in the argument list of function.

Example:

const std = @import("std");
const zigar = @import("zigar");

fn world(generator: zigar.function.Generator(?bool)) void {
    generator.end();
}

comptime {
    std.debug.assert(zigar.function.GeneratorArgOf(world) == zigar.function.Generator(?bool));
}

Arguments:

  • function: anytype
    A function or a function type.

Return value:

Generator(T,-allocating)


Generator(T,-allocating) | GeneratorOf(function)

Clone this wiki locally