June 22, 2007 Re: Soft/weak references? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bill Baxter | 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
Thanks.
Myron.
|
June 22, 2007 My implementation - was - Re: Soft/weak references? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bill Baxter Attachments: | 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. |
Copyright © 1999-2021 by the D Language Foundation