finding the offset of a variable in a class

Started by
10 comments, last by billybob 21 years, 1 month ago
I used member pointers. Except on VC7 they are broken when you access an member in a struct with one member (I know, I used GCC to check!)

I dunno, my code is a little complex. (hah!) I am going to use it for things like reflection into scripting engines and stuff, serialization, accessing things generically in a scene graph, stuff like that.
It''s kinda like a boost:roperty map on steroids

-----------------------------
Gamedev for learning.
libGDN for putting it all together.
Advertisement
thats what i''m after but only for real time property changing, and telling what variables are supposed to be transferred on the net reliably/unrealiably, or not at all, i plan on having each type edited differently. enums will be drop down menus (also macro''ed into the program), bools true/false toggle button, strings will be text enter boxes, even some advanced ones like colors maybe. 8 bit values will be a slider, it will be cool (if i can make it work )

i''m trying to avoid having to create an instance of the class and subtracting the pointers to the member and the class, i''m hoping offsetof(...) will do the trick.

This topic is closed to new replies.

Advertisement