Template type inference problem

Salih Dincer salihdb at hotmail.com
Thu Oct 3 01:04:15 UTC 2024


On Wednesday, 2 October 2024 at 23:43:43 UTC, Manu wrote:
> Here's a clearer presentation of the issue:
> ```d
> void f(T)(const(T)[] x, const(T)* y) {}
> void test()
> {
>     // this works; f(T) is inferred as f!int
>     int[] x;
>     const int y;
>     f(x, &y);
> ```

A third possibility, the following code, also works:

```d
const int*[] a;  
const int* b;

f(a, &b);
```

Interesting!

SDB at 79


More information about the Digitalmars-d mailing list