struct init() method

Timon Gehr timon.gehr at gmx.ch
Sun Feb 26 03:48:06 PST 2012


On 02/26/2012 12:18 AM, Jonathan M Davis wrote:
> On Saturday, February 25, 2012 17:07:14 Timon Gehr wrote:
>> This is useful:
>>
>> struct S{
>>       @disable enum init = 0;
>> }
>
> I thought that the way that you were supposed to do that was
>
> @disable this();
>
> - Jonathan M Davis

struct S{@disable this();}
void main(){S s = S.init;}


More information about the Digitalmars-d-learn mailing list