i want to instantiate a struct based on some type, but the type is only known after comparing some string at runtime. Is there a way to do this? Seems like type is only available at comptime.
eg
pub fn Foo(comptime T: type) type {
return struct { ... }
}
pub fn doSomething(input: []const u8) {
const my_type = if (std.mem.eql(u8, &input, some_string)) Foo else Bar;
}
(Bar is some other type)
(this doesn't work, but can I do something like this?)