2:01:57Kknewkles Q: Hi Casey! Wanted to pick your brain about metaprogramming a bit. 0 - Short of a manual comparison, how do you obtain an enum field's name by supplying a corresponding numeric value? E.g. 1 -> Sunday? Or metaprogramming is overkill for this? 1 - If you have a gigantic struct printf which you want to "automate", in the way of not having to manually enlist all its fields, metaprogramming is the way to go here, right? Probably take the definition of the struct from the (Vulkan) spec, store it in a file, for example, and match it with the struct going by the sizes and offsets of the fields?
🗪
2:01:57Kknewkles Q: Hi Casey! Wanted to pick your brain about metaprogramming a bit. 0 - Short of a manual comparison, how do you obtain an enum field's name by supplying a corresponding numeric value? E.g. 1 -> Sunday? Or metaprogramming is overkill for this? 1 - If you have a gigantic struct printf which you want to "automate", in the way of not having to manually enlist all its fields, metaprogramming is the way to go here, right? Probably take the definition of the struct from the (Vulkan) spec, store it in a file, for example, and match it with the struct going by the sizes and offsets of the fields?
🗪
2:01:57Kknewkles Q: Hi Casey! Wanted to pick your brain about metaprogramming a bit. 0 - Short of a manual comparison, how do you obtain an enum field's name by supplying a corresponding numeric value? E.g. 1 -> Sunday? Or metaprogramming is overkill for this? 1 - If you have a gigantic struct printf which you want to "automate", in the way of not having to manually enlist all its fields, metaprogramming is the way to go here, right? Probably take the definition of the struct from the (Vulkan) spec, store it in a file, for example, and match it with the struct going by the sizes and offsets of the fields?
🗪