E
easy
I start off with an interface class that has no data members and a
handful of virtual functions.
First Question: is that allowed ?
I then derived from this class and it gets included into a couple of
other classes that need that interface. The derived class had a number
of data members including a struct that allow it to do its dirty work.
When I directly access any data members (through pointers or through
public data members) in the derrived class hilarity ensues. I found
that the value returned is offset by 4 bytes( 32bits ).
for example, if I wanted:
class1.public_struct.int0
I would get
class1.public_struct.int1
more curiously this problem would only show up when i ran the release
version of the code. The debug version behaved correctly.
After an entire wasted morning I added an unused data member to the
very first interface class and all problems dissapeared like a fart in
the wind.
Main Question: Is this a compiler error or did I violate the standard?
handful of virtual functions.
First Question: is that allowed ?
I then derived from this class and it gets included into a couple of
other classes that need that interface. The derived class had a number
of data members including a struct that allow it to do its dirty work.
When I directly access any data members (through pointers or through
public data members) in the derrived class hilarity ensues. I found
that the value returned is offset by 4 bytes( 32bits ).
for example, if I wanted:
class1.public_struct.int0
I would get
class1.public_struct.int1
more curiously this problem would only show up when i ran the release
version of the code. The debug version behaved correctly.
After an entire wasted morning I added an unused data member to the
very first interface class and all problems dissapeared like a fart in
the wind.
Main Question: Is this a compiler error or did I violate the standard?