Zig 0.17.0-dev (Split by item)

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 library itself.

AlignCastResult

math.AlignCastResult
fn AlignCastResult(comptime alignment: Alignment, comptime Ptr: type) type

File

lib/std/math.zig:1099

Code

fn AlignCastResult(comptime alignment: Alignment, comptime Ptr: type) type {
    const orig = @typeInfo(Ptr).pointer;
    return @Pointer(orig.size, .{
        .@"const" = orig.is_const,
        .@"volatile" = orig.is_volatile,
        .@"allowzero" = orig.is_allowzero,
        .@"align" = alignment.toByteUnits(),
        .@"addrspace" = orig.address_space,
    }, orig.child, orig.sentinel());
}