Here’s a very interesting bit of Zig that I came across again this week: @fieldParentPtr. It’s a prism through which you can see a lot of Zig’s character. That’s not what the official docs say, of course.
It's a neat feature, tho not without dragons that made me looking for alternative ways to do interfaces in Zig: https://github.com/ziglang/zig/issues/591
I think zig does not guarantee the order of the fields in a struct, that’s why something like @filedParentPtr has to exist.
It's a neat feature, tho not without dragons that made me looking for alternative ways to do interfaces in Zig: https://github.com/ziglang/zig/issues/591
I think zig does not guarantee the order of the fields in a struct, that’s why something like @filedParentPtr has to exist.