What does assigning void mean?

mark mark at qtrac.eu
Thu Mar 5 10:58:51 UTC 2020


On Thursday, 5 March 2020 at 08:35:52 UTC, drug wrote:
> 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.

Thanks, I had read it (in "Learning D" I think), but had already 
forgotten.


More information about the Digitalmars-d-learn mailing list