diff options
| author | zooster <r00ster91@proton.me> | 2022-12-16 17:12:59 +0100 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2022-12-17 00:15:47 +0200 |
| commit | 8da9cc85af8d8f587b12e2d1ee275f50bf83b224 (patch) | |
| tree | 77ac1e60cc6649f9c4417c4ad1b2006d4ae26996 /lib/std/meta.zig | |
| parent | 8c8f6bfa642bf69a997bb64dc9bc7c89f7b86c3c (diff) | |
| download | zig-8da9cc85af8d8f587b12e2d1ee275f50bf83b224.tar.gz zig-8da9cc85af8d8f587b12e2d1ee275f50bf83b224.zip | |
std.meta: remove bitCount
Diffstat (limited to 'lib/std/meta.zig')
| -rw-r--r-- | lib/std/meta.zig | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/lib/std/meta.zig b/lib/std/meta.zig index 9dd1a97baf..71e37ad8a6 100644 --- a/lib/std/meta.zig +++ b/lib/std/meta.zig @@ -144,22 +144,6 @@ test "std.meta.stringToEnum" { try testing.expect(null == stringToEnum(E1, "C")); } -/// Deprecated, use `@bitSizeOf()`. -/// TODO Remove this after zig 0.10.0 is released. -pub fn bitCount(comptime T: type) comptime_int { - return switch (@typeInfo(T)) { - .Bool => 1, - .Int => |info| info.bits, - .Float => |info| info.bits, - else => @compileError("Expected bool, int or float type, found '" ++ @typeName(T) ++ "'"), - }; -} - -test "std.meta.bitCount" { - try testing.expect(bitCount(u8) == 8); - try testing.expect(bitCount(f32) == 32); -} - /// Returns the alignment of type T. /// Note that if T is a pointer or function type the result is different than /// the one returned by @alignOf(T). |
