Created
April 14, 2022 07:32
-
-
Save damithadayananda/1b7ee87f76dcbb2aa6b817e7e5d6db63 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package typeInference | |
import "golang.org/x/exp/constraints" | |
type Point []int32 | |
func ConstraintTypeInference(){ | |
constraintTypeInferenceDemo(Point{1,2},4) | |
} | |
func constraintTypeInferenceDemo[U ~[]T, T constraints.Integer](x []T,y T )U{ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment