IFTI needs to be updated if you accept tuples

Timon Gehr timon.gehr at gmx.ch
Tue May 28 06:47:55 UTC 2024


On 5/27/24 19:17, Basile B. wrote:
> things like
> ```d
> void test(T,U,V)((T,U,V) tuv){}
> ```
> 
> need to work with
> 
> ```d
> test((0.1, 1, false)) //  T= double, U = int, V = bool
> ```
> 
> just saying
> 

You are correct. However, it should be fixed regardless. Even if tuple 
syntax does not make it into the language, I think this code should work 
today:

```d
static import std.typecons;

void test(T,U,V)(std.typecons.Tuple!(T,U,V) tuv){}
void main(){
     test(std.typecons.tuple(0.1, 1, false));
}
```

However, it seems IFTI currently fails with fully qualified template 
instantiations.

Your code therefore indeed does not work with the prototype 
implementation of tuple syntax (which for the time being lowers tuple 
syntax to fully-qualified std.typecons template instantiations), but I 
think this is an unrelated bug.


More information about the Digitalmars-d mailing list