Replies: 1 comment
-
|
Zig 的 struct 就是命名空间而已,没有什么其他的作用,所以你的方法 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Zig 结构体方法的定义可以来自于其它结构体,只要函数的第一个参数能够接受它自己,就会成为方法
这有什么应用场景吗,感觉它可以模拟Rust的derive宏,但是好像comptime反射的实现更加的简洁
Beta Was this translation helpful? Give feedback.
All reactions