On Wednesday, 20 May 2015 at 07:27:53 UTC, jklp wrote:

---
import std.stdio;

void printVal(T)(T t) {
        writeln(t);
}

void printVal(T: T)(T* t) {
        writeln(*t);
}

void main() {
        int x = 100;
        printVal(x);
        int* px = &x;
        printVal(px);
}
---

here it's selected correctly without explicit instantiation. But honestly i don't know why since the asterisk is removed from the T it looks quite incorrect.

No it is correct it is same as:
void printVal(T: int)(T* t) {
    writeln(*t);
}

Reply via email to