我试图理解先决条件函数,并遇到了"= default“。一个快速的谷歌和扫描指南并没有带来任何结果相关。有人能给我解释一下吗?谢谢。
func precondition(condition: @autoclosure () -> Bool, _ message: @autoclosure () -> String = default, file: StaticString = default, line: UWord = default)发布于 2014-12-12 17:03:54
这并不意味着什么。您所看到的是由于头被转换为Swift的方式中的一个错误。这里有一个默认值,但是没有显示它是什么。
标头中的另一个例子是重复的where S.Generator.Element == S.Generator.Element。这只是自动翻译过程中一个错误的副产品,苹果也承认了这一点。
发布于 2014-12-12 17:08:23
把它重写为。
func precondition(condition: @autoclosure () -> Bool, _ message: @autoclosure () -> String = "default", file: StaticString = "default", line: UWord = 2)以马特的回答为例
https://stackoverflow.com/questions/27448131
复制相似问题