On Thu, 25 Oct 2007 17:57:11 +0100 Andrew Haley <aph-gcc@xxxxxxxxxxxxxxxxxxx> wrote: > John Gateley writes: > > I need to compute the offset of a data member at compile time. > > The class has virtual functions, and so the offsetof macro does > > not work (why?). > > Because it's a non-POD type. See Section 9, Classes: > > > Is there a way to do this? > > No. Consider what happens with multiple and virtual inheritance. > Thanks for the reply. It seems to me that even with multiple and virtual inheritance, the offset is a compile time constant. It may be complex to determine it, but it doesn't change. j -- John Gateley <gateley@xxxxxxxxxx>