Frank Heckenbach wrote:
Prof Abimbola Olowofoyeku wrote:
On 19 Apr 2002 at 9:10, Adam Naumowicz wrote:
I found out that, unfortunately, the newest GPC has a changed processing of constructors. As far as I know, even the virtual methods should be identified in the compilation time in the sense, that when calling a constructor for an object (for example one with destroyed layout) the methods are called inside the constructor the static way.
That's not really what it did before. What I changed was to remove a (normally) redundant VMT pointer assignment. Usually the VMT pointer is assigned when the variable is created (i.e., at program/routine start for non-pointer objects, and after memory allocation when using `New').
Until recently, GPC *also* assigned the VMT when calling a constructor which is therefore redundant (especially when calling a constructor within `New', one could see two assignments next to each other which made it clear that one was redundant).
So you could have done the other way around, assigning the VMT pointer
only when calling a constructor. This would have given what Adam was expecting. Anyway an object is not valid until a constructor is called. Is there any drawback for that ?
Maurice