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

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

bj
登录
  • 友情链接
站内
generics

generics

go

在Golang泛型中是否有一种类似于Typescript中的”extends”的方式?

英文: Is there a way in Golang Generics to create something like "extends" in Typescript? 问题...
huangapple 2022年3月29日145评论generics go
go

`any` 和 `interface{}` 作为约束条件与参数类型之间的区别是什么?

英文: Difference between any/interface{} as constraint vs. type of argument? 问题 由于Go 1.18最近发布了泛型,我开始学习...
huangapple 2022年3月26日151评论generics go
go

在golang中,有一种方法可以映射对象数组。

英文: Is there a way to map an array of objects in golang? 问题 从Node.js过来,我可以这样做: // 假设有一个包含字段`fruit`的对...
huangapple 2022年3月26日153评论generics go
go

如何编写一个通用的 Go 函数,允许指向多种原始类型的指针?

英文: How do you write a generic Go function that allows pointers to multiple primitive types? 问题 我正在尝...
huangapple 2022年3月26日151评论generics go
go

无法在类型参数值上使用类型断言。

英文: Cannot use type assertion on type parameter value 问题 我们无法在泛型类型的变量上使用类型断言。这看起来非常奇怪,因为它在interface{...
huangapple 2022年3月23日156评论generics go
go

使用类型约束的泛型:无法将false(无类型的bool常量)用作赋值中的T值

英文: Go generics with type constraints: cannot use false (untyped bool constant) as T value in assign...
huangapple 2022年3月23日140评论generics go
go

Golang同时使用接口和实现的泛型

英文: Golang generics with interface and implementation at same time 问题 我正在尝试编写以下函数: func Fill[X any](...
huangapple 2022年3月22日150评论generics go
go

限制泛型函数的类型

英文: Restrict types with generic function 问题 目前我有一个类似这样的类型: package hello type object map[string]any ...
huangapple 2022年3月22日140评论generics go
go

How to initialize an array of anonymous struct with generic field

英文: How to initialize an array of anonymous struct with generic field 问题 我想了解一下是否可以初始化一个包含泛型字段的匿名结构体...
huangapple 2022年3月21日150评论go struct
go

在Go语言(1.18版本)中,实现泛型的最佳方式是什么?

英文: What is the best way to have polymorphic implementations on a generic in go (1.18)? 问题 我想创建一个向量类...
huangapple 2022年3月20日142评论generics go
63

文章导航

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

热门标签

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

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

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

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

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

    本页二维码