mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 01:24:49 +01:00
std.mem.ReverseIterator: make public
This commit is contained in:
parent
4fa465fc8f
commit
aa2f318935
1 changed files with 3 additions and 1 deletions
|
|
@ -4002,7 +4002,9 @@ test reverse {
|
||||||
try testing.expectEqualSlices(MyType, &arr, &([_]MyType{ .c, .{ .b = 0 }, .{ .a = .{ 0, 0, 0 } } }));
|
try testing.expectEqualSlices(MyType, &arr, &([_]MyType{ .c, .{ .b = 0 }, .{ .a = .{ 0, 0, 0 } } }));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn ReverseIterator(comptime T: type) type {
|
|
||||||
|
/// Returned by `reverseIterator`.
|
||||||
|
pub fn ReverseIterator(comptime T: type) type {
|
||||||
const ptr = switch (@typeInfo(T)) {
|
const ptr = switch (@typeInfo(T)) {
|
||||||
.pointer => |ptr| ptr,
|
.pointer => |ptr| ptr,
|
||||||
else => @compileError("expected slice or pointer to array, found '" ++ @typeName(T) ++ "'"),
|
else => @compileError("expected slice or pointer to array, found '" ++ @typeName(T) ++ "'"),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue