[Issue 15464] Template parameter-dependent attributes

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Dec 24 18:02:18 PST 2015


https://issues.dlang.org/show_bug.cgi?id=15464

--- Comment #7 from Andrei Alexandrescu <andrei at erdani.com> ---
Thanks Daniel for the work and Kenji for the analysis!

There are similarities between this situation and:

static if (condition1)
void func(T)() if (condition2);

condition1 cannot use T because it hasn't "appeared" syntactically yet. Of
course, technically it's possible to make that work but it's not natural.

Somewhat similarly, for template functions it stands to reason that prefix
attributes apply to the template symbol, whereas postfix attributes apply to
the instantiation. Then:

* Attributes of the template propagate to the instantiation

* If there's a conflict between the template and instantiation attributes,
that's an error.

Sounds reasonable?

--


More information about the Digitalmars-d-bugs mailing list