Is there a weak pointer or references in D?

Nekroze nekroze at eturnilnetwork.com
Fri Jan 11 15:51:02 PST 2013


On Friday, 11 January 2013 at 22:07:45 UTC, monarch_dodra wrote:
> Honest question: How can you have a weak pointer in a language 
> that is garbage collected?

I beleive the OP means something like pythons weakref 
(http://docs.python.org/2/library/weakref.html) that is qoute:

A weak reference to an object is not enough to keep the object 
alive: when the only remaining references to a referent are weak 
references, garbage collection is free to destroy the referent 
and reuse its memory for something else.

I would like to have no how to do something like this in D aswell 
as it could be handy.


More information about the Digitalmars-d-learn mailing list