[DIP] Resolution of Alias Template Parameters in Function Templates
jmh530
john.michael.hall at gmail.com
Mon May 20 18:12:08 UTC 2019
On Monday, 20 May 2019 at 17:36:35 UTC, Stefanos Baziotis wrote:
> [snip]
>
> Both of them go to "here". The `Num` one does not go to
> "there". That is, it can't
> be distinguished whether we have an int because of an alias or
> because we
> actually had an int. And that I understand that it is one of
> the important points
> of aliases.
>
> Of course, I may have missed / misunderstood something badly in
> all of that,
> but I understand that distinguishing them (e.g. in your example
> above)
> makes template aliases different than normal aliases.
Yes, that's what you would expect to happen with a normal alias.
If you change the alias to
alias Num(T) = T;
and the second is statement to
is(T : Num!U, U)
then it becomes equivalent to what I had done above. This fails
for the same reason as discussed above.
More information about the Digitalmars-d
mailing list