Creating enums at comptime

from blog openmymind.net, | ↗ original
In Basic MetaProgramming in Zig we saw how std.meta.hasFn uses @typeInfo to determine if the type is a struct, union or enum. In this post, we'll take expand that introduction and use std.builtin.Type to create our own type. Spoiler: as far as I know, you cannot (yet) define methods on comptime-generated structs, unions or enums. Only fields....