Proposal: Implicit Function Template Value Instantiation

Quirin Schroll qs.il.paperinik at gmail.com
Wed Sep 28 19:08:40 UTC 2022


On Wednesday, 28 September 2022 at 14:42:35 UTC, FeepingCreature 
wrote:
> On Wednesday, 28 September 2022 at 13:29:14 UTC, jmh530 wrote:
>> That's an interesting idea, but what would be the advantage of 
>> this (or something like it) versus the Enum Parameters DIP [1]?
>>
>> I'm also not so trilled with the `fmt` in the second set of 
>> parentheses not having a type associated with it. I don't know 
>> if that would cause your linking errors.
>>
>> [1] 
>> https://forum.dlang.org/thread/gvypfkueypukgvxnfgtx@forum.dlang.org
>
> Oh yeah! Enum parameters seem to come down to the same thing. 
> That makes sense! I think enum parameters look a lot better, 
> too.

Nice to hear. I’ll take that as a compliment.

> An advantage of IFTVI would be that the template parameters for 
> it could be used as specializations for other parameters, but 
> that's very niche.

You mean like this?
```d
void f(string s, string t : s)(s, t) { }
```

If not could you explain it with a little more detail or an 
example?


More information about the Digitalmars-d mailing list