My implementation - was - Re: Soft/weak references

Myron Alexander someone at somewhere.com
Fri Jun 22 09:58:59 PDT 2007


Bill Baxter wrote:
> Look at the code in Phobos's std.signals for an example of how to use 
> the notifyRegister thing to implement weak references.
> 
> Note that this does not give you general purpose weak references.  It 
> will only work for class instances.  It will not give you weak 
> references to structs or arrays.
> 
> --bb

I have attached my implementation of weak references. It has been a long 
time since I used pointers and I'm not quite sure of my understanding of 
D's handling of pointers so if you see something wrong, or if you know 
of a better way to do this, please let me know.

Best regards,

Myron.
dprogramming...myron...alexander...com
replace the first ... with @, remove the second, and replace the third 
with ".".
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: WeakObjectReference.d
Url: http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20070622/cef1cea6/attachment.txt 


More information about the Digitalmars-d-learn mailing list