Why [T comparable] and not [T constraints.Comparable]?
One is inbuilt, the other is just an interface defined in a package? Compiler would check if the types all implement the required operators in both cases, no?
I am no Go programmer and don't know the language specification, just asking out of curiosity.
1 comment
[ 4.0 ms ] story [ 33.5 ms ] threadWhy [T comparable] and not [T constraints.Comparable]?
One is inbuilt, the other is just an interface defined in a package? Compiler would check if the types all implement the required operators in both cases, no?
I am no Go programmer and don't know the language specification, just asking out of curiosity.