#Cast an array/slice from `[]const u32` to `[]const enum(u32) { _ }`
1 messages · Page 1 of 1 (latest)
you can use a @ptrCast
1 messages · Page 1 of 1 (latest)
I'm trying to find a lighter weight solution to making an Iterator that converts ids from u32 to enum(u32) { _ } one at a time, and it feels like I should be able to just reinterpret the memory in-place. Is there a way to do this? In particular, when I say enum(u32) { _ }, I mean some "nominal type" representing an index.
you can use a @ptrCast