From 3b10383114f7aee96f18f7b3aac7c0e08d840b42 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 28 Jan 2026 00:43:20 -0800 Subject: [PATCH] std.meta: delete declList dubious. if people want this logic they should take responsibility for it in their own code. --- lib/std/meta.zig | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/lib/std/meta.zig b/lib/std/meta.zig index a4ce8161327e9ebebe5003810aac81e0d5c18c32..f1afa9bc7a049c5e4e13546e307b551e93e863c9 100644 --- a/lib/std/meta.zig +++ b/lib/std/meta.zig @@ -752,25 +752,6 @@ pub fn fieldIndex(comptime T: type, comptime name: []const u8) ?comptime_int { return null; } -/// Returns a slice of pointers to public declarations of a namespace. -pub fn declList(comptime Namespace: type, comptime Decl: type) []const *const Decl { - const S = struct { - fn declNameLessThan(context: void, lhs: *const Decl, rhs: *const Decl) bool { - _ = context; - return mem.lessThan(u8, lhs.name, rhs.name); - } - }; - comptime { - const decls = declarations(Namespace); - var array: [decls.len]*const Decl = undefined; - for (decls, 0..) |decl, i| { - array[i] = &@field(Namespace, decl.name); - } - mem.sort(*const Decl, &array, {}, S.declNameLessThan); - return &array; - } -} - /// Deprecated: use @Int pub fn Int(comptime signedness: std.builtin.Signedness, comptime bit_count: u16) type { return @Int(signedness, bit_count); -- 2.54.0