authorgravatar for jason@ket.soJason Phan <jason@ket.so> 2022-12-29 11:11:05-06:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2022-12-29 19:11:05+02:00
log94780f7cd19701965d9417e8d90dc6ea4d9285be
tree1881ae25b66055243087993557bbb7628d2337ef
parentc557f0c32b9effd748ad158455371ab8d5843c38
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

std: Expose Int parameter in std.PackedInt[Array,Slice]


1 files changed, 6 insertions(+), 0 deletions(-)

lib/std/packed_int_array.zig+6
......@@ -208,6 +208,9 @@ pub fn PackedIntArrayEndian(comptime Int: type, comptime endian: Endian, comptim
208208 /// The number of elements in the packed array.
209209 comptime len: usize = int_count,
210210
211 /// The integer type of the packed array.
212 pub const Child = Int;
213
211214 /// Initialize a packed array using an unpacked array
212215 /// or, more likely, an array literal.
213216 pub fn init(ints: [int_count]Int) Self {
......@@ -283,6 +286,9 @@ pub fn PackedIntSliceEndian(comptime Int: type, comptime endian: Endian) type {
283286 bit_offset: u3,
284287 len: usize,
285288
289 /// The integer type of the packed slice.
290 pub const Child = Int;
291
286292 /// Calculates the number of bytes required to store a desired count
287293 /// of `Int`s.
288294 pub fn bytesRequired(int_count: usize) usize {