Hi Quincey,
Quincey Koziol wrote:
I just found a solution for it. Is this a proper way to do it?
struct AData {//contains only variables
//variables
int acc;
char* id;
};
struct A : AData { //contains only functions
//some functions
}
Using the HOFFSET(AData, id) macro compiles now without warnings and can be
used in the insertMember function of CompType.
Looks OK to me, but I'm far from enough of a C++ expert to comment
about the style. :-) You could also just use the offsetof() macro directly,
if that works better.
I tried this, but still the same compile error. HOFFSET and offset are
basically the same, since HOFFSET is a redef of offsetof in H5Tpublic.h.
The main problem lies in the struct. offsetof() can only be used on
POD("plain old data").
However, I will tell you if I have trouble with this version.
Thanks,
~Mathias
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org