diff options
| author | Tadeo Kondrak <me@tadeo.ca> | 2020-10-17 18:04:53 -0600 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2020-11-19 18:59:21 +0200 |
| commit | 25ec2dbc1e2302d1138749262b588d3e438fcd55 (patch) | |
| tree | 34187fbd88b2e9b046f50cea93f482a191bc3248 /lib/std/meta | |
| parent | 2b7781d82ad8d2234b89257676670957e005f214 (diff) | |
| download | zig-25ec2dbc1e2302d1138749262b588d3e438fcd55.tar.gz zig-25ec2dbc1e2302d1138749262b588d3e438fcd55.zip | |
Add builtin.Signedness, use it instead of is_signed
Diffstat (limited to 'lib/std/meta')
| -rw-r--r-- | lib/std/meta/trait.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/meta/trait.zig b/lib/std/meta/trait.zig index 2455542e4f..a288b2adfd 100644 --- a/lib/std/meta/trait.zig +++ b/lib/std/meta/trait.zig @@ -195,7 +195,7 @@ test "std.meta.trait.isPacked" { pub fn isUnsignedInt(comptime T: type) bool { return switch (@typeInfo(T)) { - .Int => |i| !i.is_signed, + .Int => |i| i.signedness == .unsigned, else => false, }; } @@ -210,7 +210,7 @@ test "isUnsignedInt" { pub fn isSignedInt(comptime T: type) bool { return switch (@typeInfo(T)) { .ComptimeInt => true, - .Int => |i| i.is_signed, + .Int => |i| i.signedness == .signed, else => false, }; } |
