Lars: Please don't break up my sentences and take them out of context before you reply to them. (Hint: If a sentence begins with "so" it's not a good idea to just reply to that sentence.)
If you are caching stuff you would rather want to use a strong reference since the objects should be retained between "usages" _per definition_. You might exploit weak references + destructor resurrection to achieve some kind of on-demand, unorthodox caching mechanism but that would not be a primary use cache for weak references, nor what you suggested (deallocate objects when OOM is reached). I have also given an example of how weak references is not necessarily used for caching, therefore not directly related to it. If you want to continue to discuss "on demand deallocation", I suggest that you start a separate thread. I hope this will be more clear once the RFC is complete. I will then start a separate thread for official discussion. ~Hannes