digitalmars.D - WeakRef
- Bill Baxter <dnewsgroup billbaxter.com> Jan 21 2008
- Bill Baxter <dnewsgroup billbaxter.com> Jan 21 2008
- Bill Baxter <dnewsgroup billbaxter.com> Jan 25 2008
Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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. --bb
Oh, 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. --bb
Looks 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









Bill Baxter <dnewsgroup billbaxter.com> 