Hi, I'm wanting to create an array of this object at comptime
const Flag = struct {
name: []const u8,
aliases: []const []const u8,
used_in: []Cmd,
enabled: bool = false,
};
I have this so far:
const Flags = [_]Flag{
Flag{
.name = "installed",
.aliases = &[_][]const u8{ "-i", "--installed" },
.used_in = &[_]Cmd{.help},
},
Flag{
.name = "reload_cache",
.aliases = &[_][]const u8{ "-rc", "--reload-cache" },
.used_in = &[_]Cmd{ .list, .install },
},
};
But I'm getting a compiler error, telling me it expected type '[]Cmd', found '*const [1]Cmd'
(Cmd is just an enum)
How might I get around this?