Alias type with different initialiser.
John Colvin via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Feb 14 05:47:56 PST 2017
On Tuesday, 14 February 2017 at 10:49:19 UTC, Bastiaan Veelo
wrote:
> On Tuesday, 14 February 2017 at 01:31:10 UTC, John Colvin wrote:
>> On Monday, 13 February 2017 at 22:59:11 UTC, John Colvin wrote:
>>> [ snip ]
>>
>> sorry, made a typo, that should have been
>>
>>> alias int1 = Initial!(int, 1);
>>> static assert(int1.initial == 1); // typeof(int1.initial)
>>> == int
>>> static assert(int1.init == 1); // typeof(int1.init) ==
>>> int1
>
> What is the difference between
>
> alias Initial!(int, 1) int1;
>
> and
>
> alias int1 = Initial!(int, 1);
>
> ? Or was the typo in the comments alone?
>
> Thanks.
just a more modern style. I think the old style would have been
deprecated if it wasn't for how much old code used it.
More information about the Digitalmars-d-learn
mailing list