Skip Navigation

Packed structs in Zig make bit/flag sets trivial

devlog.hexops.com Packed structs in Zig make bit/flag sets trivial

As we've been building Mach engine, we've been using a neat little pattern in Zig that enables writing flag sets more nicely in Zig than in other languages. Here's a brief explainer.

Packed structs in Zig make bit/flag sets trivial

Bumped into this article about bit-sized booleans in Zig packed structs, thought it might be interesting to others.

0
0 comments