后台-模块-广告管理-内容页顶部广告位

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

2025-06-21 22:30:11 自媒体运营网 阅读()

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

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要标新立异用中括号?
本文部分内容转载自互联网,如果我们不小心侵犯了您的权益,联系删除
后台-模块-广告管理-内容页底部广告位
说点什么吧
  • 全部评论(0
    还没有评论,快来抢沙发吧!
自媒体运营网
我的网站,是一个记录自己生活点滴、互联网技术的原创独立博客,这是一个演示文字,可以后台修改(系统基本参数)
  • 文章133
  • 评论4
  • 浏览140
后台-模块-广告管理-右侧广告位一
后台-模块-广告管理-右侧广告位二
后台-模块-广告管理-右侧广告位三