pub fn FlagUnion(
comptime flags_arg: @EnumLiteral(),
comptime flag_arg: @EnumLiteral(),
comptime UnionArg: type,
) type u: Union2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575 pub fn FlagUnion(
comptime flags_arg: @EnumLiteral(),
comptime flag_arg: @EnumLiteral(),
comptime UnionArg: type,
) type {
return struct {
u: Union,
pub const storage: Storage = .flag_union;
pub const flags = flags_arg;
pub const flag = flag_arg;
pub const Union = UnionArg;
pub const Tag = @typeInfo(Union).@"union".tag_type.?;
};
}
The type of the field is determined by an enum within a packed struct.