小编Gib*_*nem的帖子

有没有办法在swift中声明内联函数?

我对快速的语言很新

我想在c ++中声明一个内联函数,所以我的有趣声明就像

func MyFunction(param: Int) -> Int {
...
...
...
}
Run Code Online (Sandbox Code Playgroud)

我想要做类似的事情

inline func MyFunction(param: Int) -> Int {
...
...
...
}
Run Code Online (Sandbox Code Playgroud)

我试图在网上搜索,但我没有找到任何相关的可能没有内联关键字,但也许还有另一种内联函数的方法

非常感谢 :)

inline-functions swift

35
推荐指数
3
解决办法
2万
查看次数

标签 统计

inline-functions ×1

swift ×1