digitalmars.D - WeakRef
- Bill Baxter (6/6) Jan 21 2008 Is this a good way to make a weak reference to an object?
- Bill Baxter (3/11) Jan 21 2008 Oh, and that's public domain if anyone wants to use it.
- Bill Baxter (12/20) Jan 25 2008 Looks like just a week before I sent this Tango got weak pointers. So
Is this a good way to make a weak reference to an object? Am I missing anything? The little unittest seems to work. It would be nice if something like this were in the standard library so I wouldn't have to worry about using the undocumented notifyRegister and notifyUnRegister methods. --bb
Jan 21 2008
Bill Baxter wrote:Is this a good way to make a weak reference to an object? Am I missing anything? The little unittest seems to work. It would be nice if something like this were in the standard library so I wouldn't have to worry about using the undocumented notifyRegister and notifyUnRegister methods. --bbOh, and that's public domain if anyone wants to use it. --bb
Jan 21 2008
Bill Baxter wrote:Is this a good way to make a weak reference to an object? Am I missing anything? The little unittest seems to work. It would be nice if something like this were in the standard library so I wouldn't have to worry about using the undocumented notifyRegister and notifyUnRegister methods. --bbLooks like just a week before I sent this Tango got weak pointers. So now you can do a similar thing in Tango too. http://www.dsource.org/projects/tango/forums/topic/341 BTW tango's names for the subscribe/unsubscribe functions are slightly better-named than Phobos'! rt_attachDisposeEvent and rt_detachDisposeEvent vs notifyRegister and notifyUnRegister They're not documented in Phobos, so it's not too late to pick some better names (or provide some better aliases anyway)! --bb
Jan 25 2008