You can do some interesting things using __COUNTER__ to make code using this less ugly. And if you&#x27;re willing to use a small amount of C++ templates, you can make it possible to resolve all the iteration&#x2F;member info at compile time to eliminate runtime overhead.<p>I did both of these things for Grim Fandango for vertex&#x2F;uniform buffers, so that the game could use buffers without caring about whether it was using OpenGL or console APIs - but it&#x27;s not open source :-(<p>Even if you don&#x27;t need something like this under normal circumstances, consider whether it could let you identify mistakes in debug builds, or avoid errors when writing your serialization code.