3 ms·
> template the function and generate it for any type they might need it for How? This is C++ generics. I thought Go didn't have generics?
by paulddraper 8y ago
> template the function and generate it for any type they might need it for
How? This is C++ generics. I thought Go didn't have generics?
- ainar-g 8y agoI think they meant literal generation of files based on templates. Basically sed 's/T/int/g' file@T.go > file@int.go Some people do that, I guess.
- pjmlp 8y agoThey do https://www.reddit.com/r/rust/comments/5penft/parallelizing_enjarify_in_go_and_rust/dcsgk7n/ https://www.reddit.com/r/rust/comments/5penft/parallelizing_...
- jimmy1 8y agolittle more 'go' than that, using go generate and the template package. There are also other generators that can generate a 'Stringer' for any type, etc.