It's possible to add fields to a struct based on some comptime data?
pub fn createStruct(x: anytype) type {
return struct {
// ?????
}
}
I expect the createStruct(.{"a", u8, "b", u16}) to be something like:
struct {
a: u8,
b: u16
}
In the example doesn't make so much sense, but my idea is iterate over some enum/union fields and create fields for each one. Similar to MultiArrayList, but I found MultiArrayList really annoying.