#Cast an array/slice from `[]const u32` to `[]const enum(u32) { _ }`

1 messages · Page 1 of 1 (latest)

white acorn
#

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.

white acorn
#

Ah, makes sense. Thanks!

#

You've now vicariously contributed to the Roc compiler