On 05/28/2013 05:45 PM, Kenji Hara wrote:
It looks reasonable, but in general case it would introduce not trivial@attribute("target", T) void func(string T)() {}
semantic issue.
Based on the current D language spec, prefix attribute is just rewritten
to blocked attribute.
to:
@attribute("target", T) {
void func(string T)() {}
}
It is my understanding as well, but where is this actually specified?
And block attribute can contain other declarations....
@attribute("target", T) {
enum str = T.stringof;
void func(string T)() {}
}
Well, if the enhancement is implemented, T would be deduced by the each
call of template function foo. Then the enum value would become
undeterministic.
I think it is not implementable.
This does not follow.
@attribute("target", T) void func(string T)() {}
would simply need to be treated like:(The same would then be done for other attributes.)
template func(string T){
@attribute("target", T) void func() {}
}
I think it makes a difference only for UDA's and pragmas.