diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-12-10 11:13:39 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-12-10 11:13:39 -0500 |
| commit | 9561e7c6b9fb2d9ebcbfd611196db698372ae7bd (patch) | |
| tree | 6b4fd0751e80a9c4128756d59d3c0bfecd230498 /lib/std/io.zig | |
| parent | cd4d638d10365e47bcb371119dcee22581355ac4 (diff) | |
| parent | 30715560c829d5636734edf7eabff3ee4d170e5d (diff) | |
| download | zig-9561e7c6b9fb2d9ebcbfd611196db698372ae7bd.tar.gz zig-9561e7c6b9fb2d9ebcbfd611196db698372ae7bd.zip | |
Merge branch 'Snektron-typeOf-to-TypeOf'
closes #3875
closes #1348
Diffstat (limited to 'lib/std/io.zig')
| -rw-r--r-- | lib/std/io.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/std/io.zig b/lib/std/io.zig index 68c147a33c..c8635b8551 100644 --- a/lib/std/io.zig +++ b/lib/std/io.zig @@ -663,7 +663,7 @@ pub fn BitOutStream(endian: builtin.Endian, comptime Error: type) type { pub fn writeBits(self: *Self, value: var, bits: usize) Error!void { if (bits == 0) return; - const U = @typeOf(value); + const U = @TypeOf(value); comptime assert(trait.isUnsignedInt(U)); //by extending the buffer to a minimum of u8 we can cover a number of edge cases @@ -962,7 +962,7 @@ pub fn Deserializer(comptime endian: builtin.Endian, comptime packing: Packing, /// Deserializes data into the type pointed to by `ptr` pub fn deserializeInto(self: *Self, ptr: var) !void { - const T = @typeOf(ptr); + const T = @TypeOf(ptr); comptime assert(trait.is(builtin.TypeId.Pointer)(T)); if (comptime trait.isSlice(T) or comptime trait.isPtrTo(builtin.TypeId.Array)(T)) { @@ -1091,7 +1091,7 @@ pub fn Serializer(comptime endian: builtin.Endian, comptime packing: Packing, co } fn serializeInt(self: *Self, value: var) Error!void { - const T = @typeOf(value); + const T = @TypeOf(value); comptime assert(trait.is(builtin.TypeId.Int)(T) or trait.is(builtin.TypeId.Float)(T)); const t_bit_count = comptime meta.bitCount(T); @@ -1123,7 +1123,7 @@ pub fn Serializer(comptime endian: builtin.Endian, comptime packing: Packing, co /// Serializes the passed value into the stream pub fn serialize(self: *Self, value: var) Error!void { - const T = comptime @typeOf(value); + const T = comptime @TypeOf(value); if (comptime trait.isIndexable(T)) { for (value) |v| |
