Hello,
I would like to provide some helper functions that work on pointer types and having trouble getting it to work with ~ type constraints.
I have types Foo and Bar. Bar's underlying type is Foo. I want a function that takes in pointers to types whose underlying type is Foo, but I get a compile error when trying to call this function:
*Bar does not implement ~*Foo (*Bar missing in ~*main.Foo)
Should this work?
My real use case is around a hash map library. It's implementation is a copy of Go's built-in map, but allows the user to control the equal and hash function, thus allowing keys of any type rather than just comparable types.
github.com/aristanetworks/gomap
I would like to provide
helper functions for gomap.Map similar to those provided by
golang.org/x/exp/maps and for those helpers to work on pointers to types whose underlying type is gomap.Map.
Thanks,
Aaron