DIP 1023--Resolution of Template Alias Formal Parameters in Template Functions--Community Review Round 1

ag0aep6g anonymous at example.com
Wed Sep 11 05:32:22 UTC 2019


On 11.09.19 04:02, Stefanos Baziotis wrote:
> As I understand it, because this PR and DIP handle template alias, they 
> don't handle templates (that may somehow resolve to aliases).

A "template alias" is nothing but a (simple) template that resolves to 
an alias.

This:
     alias Foo(T) = ...;
is just short for this:
     template Foo(T) { alias Foo = T; }
They are exactly the same thing to the compiler.

You can say that the DIP only applies to the simplest templates, i.e. no 
constraints, no specializations, no conditionals in the template, etc. 
But distinguishing between "template alias" and "template that resolves 
to an alias" makes no sense.

By the way, the proper term is "alias template".
https://dlang.org/spec/template.html#alias-template


More information about the Digitalmars-d mailing list