Allow weak references in containers
Brought to you by:
will_mason
Create a class called something like OLWeakReference
that will hold a reference to another object without
retaining or releasing it. This will allow containers
to behave normally, but provide the effect of not
retaining the objects added to it. This can be useful
in preventing circular reference counts and stuff like
that. Cocoa and GNUstep have this in the NSValue class,
but it's rather hidden and could be fleshed out quite a
bit.
Logged In: YES
user_id=25745
Be careful, because you'll have to change all algorithms,
including those defined for OLList and other classes.
Algorithms will have to check first to see if an object is
just a holder of a weak reference and dereference it before
performing the operation.