You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golang-nuts
Hi,
Is it possible to set a generic type parameter of "T array of any size" (not slice)? Something like:
func foo[A [...]T, T constraints.Integer](a A) {
m := map[A]string{}
...
}
Jason Phillips
unread,
Jun 6, 2022, 2:41:03 AM6/6/22
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golang-nuts
Not currently. See the "omissions" section of the proposal [1]:
> No parameterization on non-type values such as constants. This arises most obviously for arrays, where it might sometimes be convenient to write type Matrix[n int] [n][n]float64. It might also sometimes be useful to specify significant values for a container type, such as a default value for elements.