What is +++ and <<< on Swift?

做~自己de王妃 提交于 2021-02-07 05:52:26

问题


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

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?


回答1:


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

infix operator +++{ associativity left precedence 95 }

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



来源:https://stackoverflow.com/questions/38387414/what-is-and-on-swift

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!