For constraints they also could be after type name:
func IndexOf(slice []type T comparable, find T) int
or maybe this is clearer:
func IndexOf(slice []type comparable T, find T) int
This generic type information could be added on leftmost first use of the
type in the parameter list or return, an
On Tue, Jul 21, 2020 at 3:37 PM Tor Langballe wrote:
>
> This might have been discussed, but can't find anything about so easy, joined
> late...
>
> Could generic function definitions be done all in one paramter list using the
> type keyword?
>
> func IndexOf(slice []type T, find type T) int
>
>
This might have been discussed, but can't find anything about so easy,
joined late...
Could generic function definitions be done all in one paramter list using
the type keyword?
func IndexOf(slice []type T, find type T) int
or
func IndexOf(slice []type T, find T) int
instead of
func IndexO