俄罗斯妹子***漂亮热情,中国男人是不是很喜欢娶?
为什么微软出的软件都那么巨大?
TVB 演员陈慧珊转行当英语老师,称已拿博士学位,如何看待她的选择?为什么这么多 TVB 演员转行?
男性看不了女性生产场面吗?
网传前小米总监冯德兵婚内出轨,200 多份「包养合同」,这是真的吗?具体是怎么回事?
有个学舞蹈的女朋友是什么体验?

大部分语言都用尖括号<>表示泛型,为什么golang要标新立异用中括号?

发布日期:2025-06-21 17:15:17 浏览次数:0

最新的设计文档里面对这一块做了一个解释。

Why not use the syntax F like C++ and J***a? When parsing code within a function, such as v := F, at the point of seeing the < it's ambiguous whether we are seeing a type instantiation or an expression using the < operator. This is very difficult to resolve without type information. For example, consider a statement like a, b = w < x, y > (z) Withou…。

大部分语言都用尖括号<>表示泛型,为什么golang要标新立异用中括号?