On Sunday, 12 July 2015 at 10:45:52 UTC, rsw0x wrote:
On Sunday, 12 July 2015 at 09:13:03 UTC, Yuxuan Shui wrote:
For example:
import std.conv;
T a(T)(int a) {
        return to!T(a);
}
void main(){
        string x = a(2);
}

D is not able to deduce T. Can we make it possible to deduce template arguments from where the return value is assigned to?

auto a(T)(int a) {
    return to!T(a);
}

?

This doesn't seem to work in the example I gave.

Reply via email to