Now that generics is coming along, is there an easy way to extend the 
builtin map type to use a non-comparable key type? For example, given this 
constraint

type Key[T any] interface {
        Size() uint64
        Hash(seed uint64) uint64
        Equal(T) bool
}

and a type Foo like

type Foo []int
func (a Foo) Size() uint64 { ... }
func (a Foo) Hash(seed uint64) uint64 { ... }
func (a Foo) Equal(b Foo) bool { ... }

I'd like a map[Foo]struct{}. Is this possible now? Or does the runtime map 
have to be updated to support this?

-- 
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/a9296c66-7715-45ac-9fce-b1d3bc5b4343n%40googlegroups.com.

Reply via email to