What does assigning void mean?

drug drug2004 at bk.ru
Thu Mar 5 08:35:52 UTC 2020


On 3/5/20 10:47 AM, mark wrote:
> In Adam Ruppe's D Cookbook there're these lines in a ref counting example:
> 
> RefCountedObject o = void; // What does this mean/do?
> o.data = new Implementation();
> o.data.refcount = 1;
> 
> I don't understand the first line; could someone explain please?


In D all vars are initialized by default. If you use assigning void then 
the var won't be initialized.


More information about the Digitalmars-d-learn mailing list