It appears to me the current proposal does not allow you to write a
function that sorts an array of any size:
func SortArray[T comparable](array [??]T, less func(a, b T) bool) [??]T {}
Is it correct that this is not possible? Or is this expressed differently?
To clarify, I am seeking for something like:
func SortArray[T comparable, int n](array [n]T, less func(a, b T) bool)
[n]T {}
Here's two other examples that come to mind:
type Number {types ...}
func DotProduct[T Number, int n](a, b [n]T) T {} // n can be any integer
func MultMatVec[T Number, rows, cols int](m [rows][cols]T, v [cols]T)
[rows]T {}
Thanks, Markus
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/golang-nuts/7be56389-06ea-4cf4-89a0-127b05540544n%40googlegroups.com.