2 ms·
> Not having generics makes this more of a problem. If go had generics, switching between integer sizes could be a matter of recompilation using a different com
by TheDong 8y ago
> Not having generics makes this more of a problem. If go had generics, switching between integer sizes could be a matter of recompilation using a different compiler flag)
Isn't it already the case that you can switch between int sizes with compiler flags?
var i int
That will be 32 bits if I compile it with GOOS=linux GOARCH=386 and will be 32 bits if I swap in amd64 instead of 386 there.
Is there any language where generics are useful for switching between int sizes? None come to mind offhand, so I don't quite understand what you mean.