Hello All,
I am creating a toy program for complex number struct which I want to instantiate only for f32 and f64. For e.g.
pub fn Complex(comptime T: type) type { // Add code to only allow creating this type for f32 and f64 i.e. do compile error when someone tries to create this type for u8 etc. return Struct { // Value and code for complex number like abs, arg, angle etc. ... }; }
How to achieve this?
Thanks
Ashutosh