On Sunday, 21 June 2015 at 02:37:59 UTC, Yuxuan Shui wrote:
On Sunday, 21 June 2015 at 01:26:51 UTC, Adam D. Ruppe wrote:
On Saturday, 20 June 2015 at 01:50:11 UTC, Yuxuan Shui wrote:
auto ref R) is indeed a template function, so I don't
understand.
But R is not a parameter on the function itself. It comes from
the outside template.
Move it to the inside template, rewrite it as:
auto a(S, R)(auto ref R i) {
return cast(S)i*2;
}
and you should get further.
Also the same error persists even if I change 'a' to
auto a(S)(auto ref S i)
I'm not reproducing in DMD 2.067:
void main() {
int m;
a!int(m);
}
template a(R) {
auto a(S)(auto ref S i) {
}
}
Note that since template 'a' and function template 'a' have the
same name you're invoking IFTI, otherwise the code would look
like:
void main() {
int m;
z!int.a(m);
}
template z(R) {
auto a(S)(auto ref S i) {
}
}