Thread overview
What was so crazy about IFTI for parent agregate via ctor call ?
Sep 30
user1234
Sep 30
Daniel N
Oct 01
user1234
Oct 01
user1234
Oct 02
Dennis
Oct 02
user1234
September 30

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.

September 30

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

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

September 30

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

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.

October 01

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:
[...]
I've wanted this forever.

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 tuple() function is not required anymore.

October 01

On Monday, 30 September 2024 at 15:20:59 UTC, Daniel N wrote:

>

[...]
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.

If any.

October 02

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

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.