pub inline fn sentinel(comptime T: type) ?Elem(T)
pub inline fn sentinel(comptime T: type) ?Elem(T) { switch (@typeInfo(T)) { .array => |info| return info.sentinel(), .pointer => |info| { switch (info.size) { .many, .slice => return info.sentinel(), .one => switch (@typeInfo(info.child)) { .array => |array_info| return array_info.sentinel(), else => {}, }, else => {}, } }, else => {}, } @compileError("type '" ++ @typeName(T) ++ "' cannot possibly have a sentinel"); }