| ... | @@ -269,3 +269,9 @@ pub fn positionalInit(comptime T: type, args: FieldsTuple(T)) T { | ... | @@ -269,3 +269,9 @@ pub fn positionalInit(comptime T: type, args: FieldsTuple(T)) T { |
| 269 | pub fn d2index(d1len: usize, d1: usize, d2: usize) usize { | 269 | pub fn d2index(d1len: usize, d1: usize, d2: usize) usize { |
| 270 | return (d1len * d2) + d1; | 270 | return (d1len * d2) + d1; |
| 271 | } | 271 | } |
| | 272 | |
| | 273 | pub fn ensureFieldSubset(comptime L: type, comptime R: type) void { |
| | 274 | for (std.meta.fields(L)) |item| { |
| | 275 | if (!@hasField(R, item.name)) @compileError(std.fmt.comptimePrint("{s} is missing the {s} field from {s}", .{ R, item.name, L })); |
| | 276 | } |
| | 277 | } |