Hi,
I was wondering if anyone would share a neat way to determine at run time what types a structure is composed of?
Basically I want to write a function that takes a single parameter of type void*. Where the void* would be a structure. Then I want the function to be able to take apart any structure based on type and offset. I don't know how to determine what types a structure is composed of?.
I thought about doing this with templates but don't think that would work because the structures don't have similar compositions. Does that make any sense? Maybe I'm not thinking about templates correctly.
Any help here will be greatly appreciated!
thanks,
Frank
I was wondering if anyone would share a neat way to determine at run time what types a structure is composed of?
Basically I want to write a function that takes a single parameter of type void*. Where the void* would be a structure. Then I want the function to be able to take apart any structure based on type and offset. I don't know how to determine what types a structure is composed of?.
I thought about doing this with templates but don't think that would work because the structures don't have similar compositions. Does that make any sense? Maybe I'm not thinking about templates correctly.
Any help here will be greatly appreciated!
thanks,
Frank