mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-27 19:09:47 +03:00
c8aba15c22
Good riddance.
13 lines
248 B
Zig
13 lines
248 B
Zig
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);
|
|
}
|