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. Private Type Function

Bool

Private Type Function
std.os.windows.Bool
fn Bool(comptime BackingInteger: type) type

Values

  • pub const TRUE

    This is not the only truthy value, comparisons against this value are always a bug.

  • pub const Backing

Functions

pub fn toBool(b: @This()) bool
pub fn fromBool(b: bool) @This()

File

os/windows.zig:4086
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
fn Bool(comptime BackingInteger: type) type {
    return enum(Backing) {
        /// false
        FALSE = 0,
        /// true
        _,

        /// This is not the only truthy value, comparisons against this value are always a bug.
        pub const TRUE: @This() = @fromBackingInt(@intCast(1));

        pub const Backing = BackingInteger;

        pub fn toBool(b: @This()) bool {
            return b != .FALSE;
        }

        pub fn fromBool(b: bool) @This() {
            return @fromBackingInt(@intCast(@intFromBool(b)));
        }
    };
}