Just a quick thought, instead of "comparable" (and type lists) maybe we
could use a single operator to specify the required "operators" interface:

type BiMap[type V, K ==] struct {
forward map[K]V
reverse map[V]K
}

func Max[type T <](a, b T) T {

}

func ScanRowStruct[type T .](rows sql.Rows, dest *T) error {  // operator .
ensures T is a struct

}




On Mon, Aug 10, 2020 at 3:45 PM 'Carla Pfaff' via golang-nuts <
golang-nuts@googlegroups.com> wrote:

> K and V must be comparable, since you use them as map keys:
>
> type BiMap[type V, K comparable] struct {
> forward map[K]V
> reverse map[V]K
> }
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "golang-nuts" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/golang-nuts/dwZnPgTC7So/unsubscribe.
> To unsubscribe from this group and all its topics, 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/202f1ffa-ac89-42eb-b617-d82e14c537een%40googlegroups.com
> <https://groups.google.com/d/msgid/golang-nuts/202f1ffa-ac89-42eb-b617-d82e14c537een%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAMoB8rUUEQPjOejBxX4qY2aYvFUJDJ4%3Da3aXHTWD5fu9QnKgow%40mail.gmail.com.

Reply via email to