1 2 3 4 5 6 7 8 9 10 11 12
const std = @import("std"); test "lazy sizeof comparison with zero" { const Empty = struct {}; const T = *Empty; try std.testing.expect(hasNoBits(T)); } fn hasNoBits(comptime T: type) bool { return @sizeOf(T) == @sizeOf(*i32); }