My implementation - was - Re: Soft/weak references?
Myron Alexander
someone at somewhere.com
Fri Jun 22 10:08:22 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 ".".
P.S. I canceled the original message as a comment in the source was
inaccurate.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: WeakObjectReference.d
Url: http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20070622/962a6423/attachment-0001.txt
More information about the Digitalmars-d-learn
mailing list