the.bay.news

Surprising side effect using print statements

Ziggit
Surprising side effect using print statements
Hey! While trying to learn more about zigs internpool i stumbled upon this issue, which i can’t wrap my head around. Simplified Code example: const key: Key = .{ .one = .{ .one = 1234, .two = "hello world" } }; const seed = @backingInt(key); std.debug.print("{d}\n", .{seed}); switch (key) { .one => |v| { const x: u64 = std.hash.Wyhash.hash(1, std.mem.asBytes(&v)); std.debug.print("{d}\n", .{x}); }, else => {}, } const z...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.