I understand why it’s an issue, but I’m not sure what the actual solution is.
I’ve spent a bit of time looking at the way std.format.format uses anytype for its list of formatter args, but I don’t really understand what it’s doing.
I’m trying to write (yet another) CLI-arg parsing library just for fun.
My idea was to have a Parser struct that holds some Arg(T), where an Arg(T) would be able to parse the argument to a specific type (hence why I was trying to store the parse function pointer).
I don’t necessarily think I need a list of generics to solve this, but I’m not sure how I can get a generic type from a []const u8. I guess, realistically, one probably only needs a handful of types, so I could just have separate IntArg, FloatArg, EnumArg, or whatever, I just wasn’t sure if there was a way to do what I originally wanted (where a user of the library could provide their own parsing function).