| ... | @@ -752,25 +752,6 @@ pub fn fieldIndex(comptime T: type, comptime name: []const u8) ?comptime_int { | ... | @@ -752,25 +752,6 @@ pub fn fieldIndex(comptime T: type, comptime name: []const u8) ?comptime_int { |
| 752 | return null; | 752 | return null; |
| 753 | } | 753 | } |
| 754 | | 754 | |
| 755 | /// Returns a slice of pointers to public declarations of a namespace. | | |
| 756 | pub fn declList(comptime Namespace: type, comptime Decl: type) []const *const Decl { | | |
| 757 | const S = struct { | | |
| 758 | fn declNameLessThan(context: void, lhs: *const Decl, rhs: *const Decl) bool { | | |
| 759 | _ = context; | | |
| 760 | return mem.lessThan(u8, lhs.name, rhs.name); | | |
| 761 | } | | |
| 762 | }; | | |
| 763 | comptime { | | |
| 764 | const decls = declarations(Namespace); | | |
| 765 | var array: [decls.len]*const Decl = undefined; | | |
| 766 | for (decls, 0..) |decl, i| { | | |
| 767 | array[i] = &@field(Namespace, decl.name); | | |
| 768 | } | | |
| 769 | mem.sort(*const Decl, &array, {}, S.declNameLessThan); | | |
| 770 | return &array; | | |
| 771 | } | | |
| 772 | } | | |
| 773 | | | |
| 774 | /// Deprecated: use @Int | 755 | /// Deprecated: use @Int |
| 775 | pub fn Int(comptime signedness: std.builtin.Signedness, comptime bit_count: u16) type { | 756 | pub fn Int(comptime signedness: std.builtin.Signedness, comptime bit_count: u16) type { |
| 776 | return @Int(signedness, bit_count); | 757 | return @Int(signedness, bit_count); |