Replies: 1 comment 1 reply
-
回答自GTP4: 在 Zig 中,
意味着 当你将 在你的代码中, 使用 这就是为什么将 |
Beta Was this translation helpful? Give feedback.
-
回答自GTP4: 在 Zig 中,
意味着 当你将 在你的代码中, 使用 这就是为什么将 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
先上代码:
这段代码主要想测试的是
fieldPtr
这个函数,这个函数作用就是想把第一个参数的由第二个参数指定的field返回,并保证返回的是一个指针。上面代码在zig 0.12.0-dev.1861+412999621 下编译会失败,报错:
修复方法很简单,只要把函数
fieldIsPtr
改成inline的就可以了,至于原因,本人目前不是很清楚,所以留下贴子希望有人能解答。Beta Was this translation helpful? Give feedback.
All reactions