开发者交流平台
开发者交流平台

通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。

bj
登录
  • 友情链接
站内
generics

generics

go

为什么Go泛型不支持将结构体作为返回值?

英文: Why Go generics not support Struct as return value? 问题 Go版本是1.18-rc,这是我的代码: type Dog struct { Na...
huangapple 2022年2月22日148评论generics go
go

如何将类型限制为具有索引的类型?

英文: How to constrain type to types with index? 问题 我决定深入学习Go语言,因为1.18版本引入了泛型。我想实现一个只接受顺序类型(数组、切片、映射、字...
huangapple 2022年2月21日154评论go slice
go

如何检查泛型类型的值是否为零值?

英文: How to check if the value of a generic type is the zero value? 问题 泛型提案中有一个章节,介绍了如何返回类型参数的零值,但没有提...
huangapple 2022年2月20日150评论generics go
go

如何解决“接口方法不能有类型参数”的问题?

英文: How to solve "interface method must have no type parameters"? 问题 我正在尝试在1.18beta2中使用go泛...
huangapple 2022年2月16日207评论generics go
go

How to declare and use a struct field which can store both string and int values?

英文: How to declare and use a struct field which can store both string and int values? 问题 我有以下的结构体: t...
huangapple 2022年2月11日155评论generics go
go

接口包含类型约束:无法在转换中使用接口。

英文: interface contains type constraints: cannot use interface in conversion 问题 type Number interface...
huangapple 2022年2月11日151评论generics go
go

使用泛型实现可比较的 Go 结构体。

英文: go struct with generics implementing comparable 问题 考虑以下用于 go1.18beta2 版本的 Linux/amd64 的代码片段: typ...
huangapple 2022年2月10日147评论generics go
go

通用切片参数和限制为切片类型的参数之间有什么区别?

英文: What's the difference between a generic slice argument and an argument constrained to slice ...
huangapple 2022年2月10日151评论go slice
go

如何分配或返回由联合约束的通用类型T?

英文: How to assign or return generic T that is constrained by union? 问题 换句话说,我如何为联合类型集中的不同类型实现特定类型的解决...
huangapple 2022年2月9日148评论generics go
go

在Go泛型(版本1.18或更高版本)中,可以使用”void”类型作为参数化类型。

英文: Using "void" type as a parameterized type in Go generics (version 1.18) or above 问题 Go...
huangapple 2022年2月9日150评论generics go
63

文章导航

1 … 31 32 33 34 35 36 37 38 39 … 63
name
开发者交流平台
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
文章117266 留言 4 访客17169308

热门标签

go arrays spring html typescript spring-boot c# flutter c++ node.js r pandas sql python android css json javascript java reactjs

悟已往之不谏,知来者之可追!

今日
00%
已00小时
本周
00%
已过00天
本月
00%
已过00天
今年
00%
已是00月

Copyright ©  开发者交流平台 版权所有.

闽 ICP 备 2022019110 号 - 1
  • 开发者交流平台

    本页二维码