B
Ben Bacarisse
jacob navia said:But it forces it upon you!
In C you can do it:
1) Without destructors using a GC In that case the code is even shorter:
2) Using a common heap you can free all memory used by all the created
lists in a single call to "DestroyHeap"
3) Using destructors as I showed you in the last message.
Which one is choosen depends on your application and context. Now,
in C++ you have only ONE method: destructors. It is forced upon you
by the language. Method 1 (GC) is inefficient because the destructors
are called anyway. The same for method 2.
All these options are available in C++ and since you don't have to have
a destructor there's no cost unless you need one.
What does the CCL do about allocators? Can one control where storage
comes from for different container objects? This is important to make
number 2) really useful.
<snip>