0
Swift中“with”关键字的用途是什么?到目前为止,我发现如果您需要覆盖现有的全局函数(如toDebugString),则可以使用该关键字。Swift“with”关键字
// without "with" you get "Ambiguous use of 'toDebugString'" error
func toDebugString<T>(with x: T) -> String
{
return ""
}
toDebugString("t")