authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-01-28 00:43:20-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-01-28 00:43:20-08:00
log3b10383114f7aee96f18f7b3aac7c0e08d840b42
tree0f4976f37e591f147d43a22553fdd829bf2f89d7
parent204fa8959a8f9d5457705f338eb0461e54155796

std.meta: delete declList

dubious. if people want this logic they should take responsibility for it in their own code.

1 files changed, 0 insertions(+), 19 deletions(-)

lib/std/meta.zig-19
......@@ -752,25 +752,6 @@ pub fn fieldIndex(comptime T: type, comptime name: []const u8) ?comptime_int {
752752 return null;
753753}
754754
755/// Returns a slice of pointers to public declarations of a namespace.
756pub 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
774755/// Deprecated: use @Int
775756pub fn Int(comptime signedness: std.builtin.Signedness, comptime bit_count: u16) type {
776757 return @Int(signedness, bit_count);