Tuples, CTFE, and Sliding Template Arguments

Walter Bright newshound2 at digitalmars.com
Sat Jan 13 03:40:25 UTC 2024


On 1/12/2024 7:05 PM, Andrej Mitrovic wrote:
> What happens here?
> 
> ```D
> void pluto(string s = "default", Args...)(Args args)
> {
> }
> 
> void main () {
>      pluto("foo");
>      pluto("foo", "bar");
> }
> ```

They will compile as:

```
pluto!"default"("foo");
pluto!"default"("foo", "bar");
```
i.e. as they would now. Existing conventional overloads would be the "better" 
match. Sliding templates would only be tried if the alternative was a failure to 
match.


More information about the Digitalmars-d mailing list