Feel confused with lifetime of anonymous struct

@AndrewCodeDev : Thanks for consolidating all discussions on this topic into a single thread. Easier to read it all in one place rather than scattered around.

BTW, I think this question belongs to FAQ. Struct literals are quite unique feature of Zig not found in other languages and it is very easy to get them wrong. They are rather different beast than number or string literals and internalizing it takes some effort.

1 Like