Cannot alias null

monarch_dodra via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jun 12 15:38:44 PDT 2014


On Thursday, 12 June 2014 at 20:44:16 UTC, H. S. Teoh via 
Digitalmars-d-learn wrote:
> On Thu, Jun 12, 2014 at 03:26:13PM -0500, Tom Browder via 
> Digitalmars-d-learn wrote:
>> This will not compile:
>> 
>>   alias blah = null;
> [...]
>
> 'null' is a value, not a type. Try:
>
> 	alias blah = typeof(null);
>
>
> T

Yet you can alias variables...

int i;
alias j = i;

So there's something special about "null".


More information about the Digitalmars-d-learn mailing list