Type Function Tuple [src]
For a given anonymous list of types, returns a new tuple type
with those types as fields.
Examples:
Tuple(&[_]type {}) ⇒ tuple { }
Tuple(&[_]type {f32}) ⇒ tuple { f32 }
Tuple(&[_]type {f32,u32}) ⇒ tuple { f32, u32 }
Prototype
pub fn Tuple(comptime types: []const type) type
Parameters
types: []const type
Example
test Tuple {
TupleTester.assertTuple(.{}, Tuple(&[_]type{}));
TupleTester.assertTuple(.{u32}, Tuple(&[_]type{u32}));
TupleTester.assertTuple(.{ u32, f16 }, Tuple(&[_]type{ u32, f16 }));
TupleTester.assertTuple(.{ u32, f16, []const u8, void }, Tuple(&[_]type{ u32, f16, []const u8, void }));
}
Source
pub fn Tuple(comptime types: []const type) type {
return CreateUniqueTuple(types.len, types[0..types.len].*);
}