Zig 函数调用时,传值 or 传引用 #69
jiacai2050
started this conversation in
General
Replies: 1 comment 2 replies
-
函数参数传递值的问题的话,基本类型肯定是直接复制,因为只涉及到寄存器的拷贝,但关于复杂类型的传递,并没有明确说明具体是引用还是值传递,但zig保证了参数是常量 const,这里有个相关的issue提到了一些问题,ziglang/zig#5973 后面这个情况或许会做出一些改变 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
https://www.1a-insec.net/blog/25-zig-reference-semantics/
https://ziglang.org/documentation/0.11.0/#Pass-by-value-Parameters
Beta Was this translation helpful? Give feedback.
All reactions