inline fn typeContainsSlice(comptime K: type) bool K: type164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179inline fn typeContainsSlice(comptime K: type) bool {
return switch (@typeInfo(K)) {
.pointer => |info| info.size == .slice,
inline .@"struct", .@"union" => |info| {
inline for (info.field_types) |field_type| {
if (typeContainsSlice(field_type)) {
return true;
}
}
return false;
},
else => false,
};
}