On Tue, Jan 12, 2021 at 12:29 PM Keith Wipf <keithwi...@gmail.com> wrote: > > Also, will Go generics support specialization? I thought that I saw > somewhere that you would be able to switch on a type parameter at > compile time. I'm thinking you'd need this to serialize ints and other > primitive types because you can't implement any serialize functions on > those without making a new type.
The current type parameters design draft does not support specialization. Specialization would significantly increase the complexity, as it would be necessary to clearly define when a specialization would apply. In Go, serialization is more likely to be implemented using reflection, as is done today, without generics, by packages like encoding/json. Ian -- 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 golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAOyqgcUbx8GMyPNZmtCHBbtBjwbyQ%2B%3Dme2u1mONXWH5u6Nogwg%40mail.gmail.com.