| ... | @@ -71,6 +71,11 @@ pub fn AlignedArrayList(comptime T: type, comptime alignment: ?u29) type { | ... | @@ -71,6 +71,11 @@ pub fn AlignedArrayList(comptime T: type, comptime alignment: ?u29) type { |
| 71 | return self.toSliceConst()[i]; | 71 | return self.toSliceConst()[i]; |
| 72 | } | 72 | } |
| 73 | | 73 | |
| | 74 | /// Safely access ptr to index i of the list. |
| | 75 | pub fn ptrAt(self: Self, i: usize) *T { |
| | 76 | return &self.toSlice()[i]; |
| | 77 | } |
| | 78 | |
| 74 | /// Sets the value at index `i`, or returns `error.OutOfBounds` if | 79 | /// Sets the value at index `i`, or returns `error.OutOfBounds` if |
| 75 | /// the index is not in range. | 80 | /// the index is not in range. |
| 76 | pub fn setOrError(self: Self, i: usize, item: T) !void { | 81 | pub fn setOrError(self: Self, i: usize, item: T) !void { |