Go generics: type constraint for function or (non-type constraint) interface?

瀏覽次數:133 次
跳到第一則未讀訊息

TheDiveO

未讀,
2022年9月28日 下午3:05:232022/9/28
收件者:golang-nuts
Is there currently a way in Go generics to express a type constraint to allow only
- any function
- any interface that isn't a type constraint, such as ~int
?

Axel Wagner

未讀,
2022年9月28日 下午3:12:162022/9/28
收件者:TheDiveO、golang-nuts
No and no.

--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/16b6413d-fd37-4f37-8c42-7665764a465bn%40googlegroups.com.

TheDiveO

未讀,
2022年10月9日 下午4:10:112022/10/9
收件者:golang-nuts
Thank you! I was already expecting a twin no, but wanted to ensure that I didn't had overlooked something.
回覆所有人
回覆作者
轉寄
0 則新訊息