For reference it's the old DIP 40 0 so a thing like
struct IPersonallyPresentYouDip40(T)
{
this(T t){}
}
void main()
{
auto v = IPersonallyPresentYouDip40(0); // infer `int` for `T`
}
should work.
Thread overview |
---|
September 30 What was so crazy about IFTI for parent agregate via ctor call ? | ||||
---|---|---|---|---|
| ||||
For reference it's the old DIP 40 0 so a thing like
should work. |
September 30 Re: What was so crazy about IFTI for parent agregate via ctor call ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to user1234 | 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
should work. I've wanted this forever. https://issues.dlang.org/show_bug.cgi?id=6082 -Steve |
September 30 Re: What was so crazy about IFTI for parent agregate via ctor call ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Steven Schveighoffer | 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
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. Since they sorted it out in C++, many of the potential risks should already be understood. |
October 01 Re: What was so crazy about IFTI for parent agregate via ctor call ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Steven Schveighoffer | 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: https://issues.dlang.org/show_bug.cgi?id=6082 -Steve That old ;) Can this ER be pre-approved ? It's a pure semantics change, plus for now it's an error. I dont think this error is ever involved during the rare time D does SFINAE. I think there's a real value added by this feature, many simplifications. I'm sure you (Steven) know that already but for the others: imagine that the |
October 01 Re: What was so crazy about IFTI for parent agregate via ctor call ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Daniel N | On Monday, 30 September 2024 at 15:20:59 UTC, Daniel N wrote: >[...] Since they sorted it out in C++, many of the potential risks should already be understood. If any. |
October 02 Re: What was so crazy about IFTI for parent agregate via ctor call ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to user1234 | On Monday, 30 September 2024 at 12:50:49 UTC, user1234 wrote: >Prototype implementation: https://github.com/dlang/dmd/pull/16910 It currently fails if it gets slightly more complicated than your example, but it works as a proof of concept. |
October 02 Re: What was so crazy about IFTI for parent agregate via ctor call ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dennis | On Wednesday, 2 October 2024 at 15:35:40 UTC, Dennis wrote: >On Monday, 30 September 2024 at 12:50:49 UTC, user1234 wrote: >Prototype implementation: https://github.com/dlang/dmd/pull/16910 It currently fails if it gets slightly more complicated than your example, but it works as a proof of concept. Thnaks, that's a good news. Impressive also to see how simple the change finally is. |