Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn getCapacity(comptime ComponentLists: type, comptime T: type) usize {
- comptime var capacity: usize = 0;
- inline for (@typeInfo(ComponentLists).Struct.fields) |sfield| {
- comptime if (std.mem.eql(u8, sfield.name, @typeName(T))) {
- capacity = sfield.field_type.capacity;
- };
- }
- return capacity;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement