Template and Type Literals

monkyyy crazymonkyyy at gmail.com
Wed May 22 20:30:33 UTC 2024


On Tuesday, 21 May 2024 at 17:38:41 UTC, Quirin Schroll wrote:
> A type literal is something like struct { … }, which you could 
> use as a template argument instead of a named struct.

when named arguments work with templates, it may just work to use 
"pack"

```d
template pack(T...){
   alias unpack=T;
}

template usestruct(alias S){
   alias S_=S.unpack;
   ...
}
alias foo=usesstruct!(pack!(i:int,f:float));
```

idk when thats coming tho


More information about the dip.ideas mailing list