If I make a generic, like a function that returns a struct type, can I make some version of the generic have a value in the steuxt and another not? Not just null the value, but completely omit it from the struct?
Example:
pub fn Image(comptime color_type: ColorType) type {
return struct {
width: u8,
height: u8,
if (color_type == .indexed) palette: []Color,
pixels: [][]Color
}
}
Where Image(.indexed) has the palette but Image(.rgb) does not?