P
Paul Jackson
I have the following situation:
class Y;
class Z;
class X {
public:
Y y;
Z* z;
};
X::X() : y(3) {
z = new Z;
};
class Z is fairly complicated, i.e., it publicly inherits from two base
classes, one of those base classes itself publicly inherits from two base
classes, etc.
When X::X is in the assignment phase, mmebers in y are getting corrupted
during the construction of z.
Are there any typical problems to look for to solve this mess? Using g++,
are there any compiler flags that should be turned on that may point to the
problem area or assist with debugging using gdb?
class Y;
class Z;
class X {
public:
Y y;
Z* z;
};
X::X() : y(3) {
z = new Z;
};
class Z is fairly complicated, i.e., it publicly inherits from two base
classes, one of those base classes itself publicly inherits from two base
classes, etc.
When X::X is in the assignment phase, mmebers in y are getting corrupted
during the construction of z.
Are there any typical problems to look for to solve this mess? Using g++,
are there any compiler flags that should be turned on that may point to the
problem area or assist with debugging using gdb?