go typeparam 源码

  • 2022-07-15
  • 浏览 (1149)

golang typeparam 代码

文件路径:/misc/cgo/test/typeparam.go

// Copyright 2021 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package cgotest

// #include <stddef.h>
import "C"

func generic[T, U any](t T, u U) {}

func useGeneric() {
	const zero C.size_t = 0

	generic(zero, zero)
	generic[C.size_t, C.size_t](0, 0)
}

相关信息

go 源码目录

相关文章

go backdoor 源码

go buildid_linux 源码

go callback 源码

go cgo_linux_test 源码

go cgo_stubs_android_test 源码

go cgo_test 源码

go cgo_thread_lock 源码

go cgo_unix_test 源码

go issue1435 源码

go issue18146 源码

0  赞