什么是+++和<<<<<<<<<<<<<<<<<<<<<<<<<<在斯威夫特? [英] What is +++ and <<< on Swift?

查看:54
本文介绍了什么是+++和<<<<<<<<<<<<<<<<<<<<<<<<<<在斯威夫特?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从这个 github 项目 中知道 Swift 有 +++code> 和 <<<< 操作符".

I just know from this github project that Swift has +++ and <<< "operators".

我很难在谷歌上搜索这个,因为 +++<<< 可能是某种特殊字符并且没​​有出现在搜索中结果根本.当我写问题标题时,它甚至没有出现在可能已经有你答案的问题 Stack Overflow 部分.

It's hard for me to search for this on google because +++ and <<< maybe some kind of special characters and not showing up on search result at all. It's not even showing up on questions that may already have your answer section of Stack Overflow when I wrote the question title.

您能否简要解释一下这些奇怪的运算符的用途,或者一些文章链接以供进一步阅读?

Can you explain briefly what are these weird operators for, and maybe some articles link for further reading?

推荐答案

那些运算符不是 Swift 的一部分.它们在该 repo 中定义,仅在包含该模块的项目中才有意义.看看 https://github.com/xmartlabs/Eureka/blob/master/Source/Core/Operators.swift#L27

Those operators are not a part of Swift. They are defined within that repo and meaningful only within projects which include that module. Take a look at https://github.com/xmartlabs/Eureka/blob/master/Source/Core/Operators.swift#L27

<代码>中缀运算符 +++{ 关联性左优先级 95 }

https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/AdvancedOperators.html 了解有关在 Swift 中实现自定义运算符的更多信息.

and https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/AdvancedOperators.html for more on implementing custom operators in Swift.

这篇关于什么是+++和&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;在斯威夫特?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆