Tuples, CTFE, and Sliding Template Arguments

Steven Schveighoffer schveiguy at gmail.com
Sat Jan 13 18:25:54 UTC 2024


On Saturday, 13 January 2024 at 13:14:28 UTC, Nick Treleaven 
wrote:
> On Friday, 12 January 2024 at 22:35:54 UTC, Walter Bright wrote:
>> So, instead of issuing a compilation error, the compiler can 
>> "slide" the arguments to the left, so the first argument is 
>> moved into the compile time parameter list. Then, the call 
>> will compile.
>
> FeepingCreature proposed this instead, which seems to be more 
> flexible and clearer:
> https://forum.dlang.org/post/arzmecuotonnomsehrmk@forum.dlang.org


I like this one, the only thing to think about is what to do with 
existing calls like:

```d
format!"%s"("hello");
```

What goes where? Does "hello" get pushed to the args, or is it 
still the format string? Does it just not match that overload, 
and now you need separate overloads for when you explicitly 
instantiate with a parameter?

-Steve


More information about the Digitalmars-d mailing list