On Thu, Aug 4, 2016 at 3:33 PM, T L <tapir....@gmail.com> wrote: > > With some special memory optimizations for slice, I think it is possible to > make efficient conversions from []T to []interface. > For example, we don't need to convert every element in []T to interface{}, > we can just use following struct to represent a special []interface{}, > the concrete type of all interface{} values in the []interface{} is the same > one. >> >> type specialInterfaceSlice struct { >> typ *_type >> values []T >> } >
That avoids the copy, but makes it impossible to take the address of an interface{} in that []interface{}. -- 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. For more options, visit https://groups.google.com/d/optout.