I don't understand why this behaves as it does. Given the following two templates:

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

I find that I actually have to explicitly instantiate the template with a pointer type to get the specialization.

```
void main() {
        int x = 100;
        printVal(x);
        int* px = &x;
        printVal(px);        // prints the address
        printVal!(int*)(px)  // prints 100
}
```

Intuitively, I would expect the specialization to be deduced without explicit instantiation. Assuming this isn't a bug (I've been unable to turn up anything in Bugzilla), could someone in the know explain the rationale behind this?

Reply via email to