D
Dennis \(Icarus\)
jacob navia said:Nick Keighley a écrit :jacob navia a écrit :After posting [about an implementaion of a tree], I have just discovered
that I can do > the transition
between the smallish 65535 limited trees to the 32 bit ones
AUTOMATICALLY!
Since I keep the count of the elements in the tree header, when I arrive
at inserting the 65537th element I have just to change the POINTER of
the vtable to point to the vtable of the 32 bit version, reallocate the
nodes in 32 bits and go on!
This is completely impossible to do in C++ since an object can't change
dynamically its class at runtime.
nonsense. Anything you can do in C you can do in C++.
No. In C++ you can't manipulate the vtable for an object...
It is the compiler that manages it. You can't even access it.
You can't change
types dynamically in either C or C++.
True. But in C you canchange the vtable for an object,
what you can't do in C++.
<snip>
So it does look like you're talking about virtual method table.
Cool.
Since C doesn't have virtual methods it's difficult to manipulate it.
If you're implementing your own vtable, this can be done in C++ as well.
Dennis