aboutsummaryrefslogtreecommitdiff
path: root/lib/std/packed_int_array.zig
diff options
context:
space:
mode:
authorJason Phan <jason@ket.so>2022-12-29 11:11:05 -0600
committerGitHub <noreply@github.com>2022-12-29 19:11:05 +0200
commit94780f7cd19701965d9417e8d90dc6ea4d9285be (patch)
tree1881ae25b66055243087993557bbb7628d2337ef /lib/std/packed_int_array.zig
parentc557f0c32b9effd748ad158455371ab8d5843c38 (diff)
downloadzig-94780f7cd19701965d9417e8d90dc6ea4d9285be.tar.gz
zig-94780f7cd19701965d9417e8d90dc6ea4d9285be.zip
std: Expose Int parameter in std.PackedInt[Array,Slice]
Diffstat (limited to 'lib/std/packed_int_array.zig')
-rw-r--r--lib/std/packed_int_array.zig6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/std/packed_int_array.zig b/lib/std/packed_int_array.zig
index c2129381a5..f15ddbe974 100644
--- a/lib/std/packed_int_array.zig
+++ b/lib/std/packed_int_array.zig
@@ -208,6 +208,9 @@ pub fn PackedIntArrayEndian(comptime Int: type, comptime endian: Endian, comptim
/// The number of elements in the packed array.
comptime len: usize = int_count,
+ /// The integer type of the packed array.
+ pub const Child = Int;
+
/// Initialize a packed array using an unpacked array
/// or, more likely, an array literal.
pub fn init(ints: [int_count]Int) Self {
@@ -283,6 +286,9 @@ pub fn PackedIntSliceEndian(comptime Int: type, comptime endian: Endian) type {
bit_offset: u3,
len: usize,
+ /// The integer type of the packed slice.
+ pub const Child = Int;
+
/// Calculates the number of bytes required to store a desired count
/// of `Int`s.
pub fn bytesRequired(int_count: usize) usize {