Alias question ( 1.0 )

Walter Bright newshound1 at digitalmars.com
Mon Apr 14 19:23:41 PDT 2008


Edward Diener wrote:
> Walter Bright wrote:
>> Edward Diener wrote:
>>> I am trying to understand the difference between and alias type and 
>>> an alias declaration.
>>
>> An alias type works analogously to C's typedef. An alias declaration 
>> gives an alternate name for any other name, like:
>>
>>     alias foo.bar baz;
>>
>> is sort of equivalent to the C:
>>
>>     #define baz foo.bar
> 
> OK, so an alias creates a compile-time symbol which stands for another 
> symbol, as long as the symbol it stands for is not an expression but a 
> declaration instead.

Right. You can alias any symbol - other aliases, variable names, module 
names, function names, template names, struct names, etc.



More information about the Digitalmars-d mailing list