Zig's @bitCast

In an older post, we explored Zig's @ptrCast and then looked at a concrete usage in the shape of std.heap.MemoryPool . @ptrCast As a brief recap, when we use @ptrCast , we're telling the compiler to treat a pointer as a given type. For example, this code runs fine: const std = @import("std"); pub fn main() !void { var user = User{.power = 9001, .name = "Goku", .active = true}; const cat: *Cat =…