I would like to implement a generic function that takes in a string that has 3 entries separated by spaces, and either parses it to a glam::Vec3 or a glam::IVec3depending on whether a generic type parameter is f32 or i32. This generic type is known at compile time, i.e. the "angle bracket" generic syntax.
The biggest reason I can't seem to get started implementing it is that I don't know how to switch on a generic type. In typescript one could use instanceof but that doesn't really work here.
Please provide a suggestion on how to get started.