fn Bool(comptime BackingInteger: type) type 4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106fn 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)));
}
};
}