Re:The Next Step for Generics
by marcus_holmes on Wednesday June 17, 2020 @12:52AM
(#23547942)
I think this is probably the single best use case for Generics for Go - numerical operations on the range of number types.
What about algorithms (sorts, folds, etc) on those containers? I write a lot of numerical code. It sucks to do multiple maintenance for functions that work on arrays of floats, doubles, complex floats, and complex doubles. Templates/Generics are a huge win for me here. Some functions work nicely on integer types too.