What was so crazy about IFTI for parent agregate via ctor call ?
Daniel N
no at public.email
Mon Sep 30 15:20:59 UTC 2024
On Monday, 30 September 2024 at 15:15:54 UTC, Steven
Schveighoffer wrote:
> On Monday, 30 September 2024 at 12:50:49 UTC, user1234 wrote:
>> For reference it's the old DIP 40 [0] so a thing like
>>
>> ```d
>> struct IPersonallyPresentYouDip40(T)
>> {
>> this(T t){}
>> }
>>
>> void main()
>> {
>> auto v = IPersonallyPresentYouDip40(0); // infer `int` for
>> `T`
>> }
>> ```
>>
>> should work.
>
> I've wanted this forever.
>
> https://issues.dlang.org/show_bug.cgi?id=6082
>
> -Steve
C++17 got this already... D used to leave C++ in the dust.
https://en.cppreference.com/w/cpp/language/class_template_argument_deduction
Since they sorted it out in C++, many of the potential risks
should already be understood.
More information about the Digitalmars-d
mailing list