[Proposal] Weak reference implementation for D

Robert jfanatiker at gmx.at
Tue Oct 15 14:58:05 PDT 2013


>
> So, here are your revised version:
> https://github.com/phobos-x/phobosx/blob/1f0016c84c2043da0b9d2dafe65f54fcf6b6b8fa/source/phobosx/signal.d
>
> Sorry, but you are making the same mistake again.

Yeah, I made a mistake again. In my mind it was ok because "o" is 
read from a shared variable, but this is not true, as it is read 
from a temporary, which does not hold a visible address.

It is getting embarrassing, but I really appreciate your help in 
making it a rock solid solution. Thank you! I hope my next try is 
working out better, I have to sleep over it and re-examine it, 
but maybe you want to have a look, you are usually faster and 
more reliable in finding flaws than myself ;-) :

https://github.com/phobos-x/phobosx/blob/master/source/phobosx/signal.d

The relevant code is now in InvisibleRef.address and 
InvisibleRef.makeVisible/makeInvisible.

Best regards,

Robert




More information about the Digitalmars-d mailing list