| 1 | const std = @import("std"); |
| 2 | const string = []const u8; |
| 3 | const extras = @import("./lib.zig"); |
| 4 | |
| 5 | pub fn isTuple(comptime T: type) bool { |
| 6 | return is(.@"struct")(T) and @typeInfo(T).@"struct".is_tuple; |
| 7 | } |
| 8 | fn is(comptime id: std.builtin.TypeId) fn (type) bool { |
| 9 | const Closure = struct { |
| 10 | pub fn trait(comptime T: type) bool { |
| 11 | return id == @typeInfo(T); |
| 12 | } |
| 13 | }; |
| 14 | return Closure.trait; |
| 15 | } |