I\'m trying to write a tool that will take as input some C code containing structs. It will compile the code, then find and output the size and offset of any padding the com
There is no C++ language feature to iterate through the members of a struct, so I think you're out of luck.
You might be able to cut down some of the boiler-plate with a macro, but I think you're stuck specifying all the members explicitly.