jacob navia a écrit :
[snip]
After posting that, 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.
This idea has far reaching consequences for doing dynamically adaptive
data structures. I could start all containers in the "smallish" version,
and grow as needed.
What is interesting in the C version is that it is completely dynamic.
You can adapt the data structure to new conditions AS NEEDED, without
having to fix everything during the compilation.
True, the insertion of the 65537th element will take some time...
Happily for C++ users, the library will be available for them too.
Just add the
extern "C"
jacob