August 25
On Sunday, 24 August 2025 at 20:43:15 UTC, Ali Çehreli wrote:

> I think you went a little further in that section and made the return 'auto ref', which does not (and should not) fail compilation.

No. auto ref is only for templates. This is a bug and should not compile.

-Steve
August 25
On Sunday, 24 August 2025 at 18:29:12 UTC, Brother Bill wrote:
> On Sunday, 24 August 2025 at 17:30:33 UTC, Ali Çehreli wrote:
>> [...]
>
>> [...]
>
> Ali, may I have a Yes or No on permission to use your Programming in D examples that I am expanding for a commercial Udemy course that I will build.  Of course, I will provide any Copyright notice that you provide, if permission is granted.
>
> [...]

I suggest also to take a look at this [1], is a little old but I think it's still _very_ valuable.

[1] https://github.com/PhilippeSigaud/D-templates-tutorial
August 25
On Monday, 25 August 2025 at 00:42:33 UTC, Steven Schveighoffer wrote:
> On Sunday, 24 August 2025 at 20:43:15 UTC, Ali Çehreli wrote:
>
>> I think you went a little further in that section and made the return 'auto ref', which does not (and should not) fail compilation.
>
> No. auto ref is only for templates. This is a bug and should not compile.

An auto ref function does not need to be a template because the ref-ness does not depend on how it's called.

https://dlang.org/spec/function.html#auto-ref-functions


August 25
On Monday, 25 August 2025 at 08:36:05 UTC, Nick Treleaven wrote:
> On Monday, 25 August 2025 at 00:42:33 UTC, Steven Schveighoffer wrote:
>> On Sunday, 24 August 2025 at 20:43:15 UTC, Ali Çehreli wrote:
>>
>>> I think you went a little further in that section and made the return 'auto ref', which does not (and should not) fail compilation.
>>
>> No. auto ref is only for templates. This is a bug and should not compile.
>
> An auto ref function does not need to be a template because the ref-ness does not depend on how it's called.
>
> https://dlang.org/spec/function.html#auto-ref-functions

Well today I learned this. But it is true for auto ref params.

Still, the op code compiling is a bug as the return value is not an rvalue.

-Steve
August 25
On Monday, 25 August 2025 at 12:57:01 UTC, Steven Schveighoffer wrote:
> On Monday, 25 August 2025 at 08:36:05 UTC, Nick Treleaven wrote:
>> On Monday, 25 August 2025 at 00:42:33 UTC, Steven Schveighoffer wrote:

> Still, the op code compiling is a bug as the return value is not an rvalue.
>
> -Steve

Who should report this bug to the D ticketing system?
This is above my pay grade now.
August 25

On Monday, 25 August 2025 at 12:59:58 UTC, Brother Bill wrote:

>

On Monday, 25 August 2025 at 12:57:01 UTC, Steven Schveighoffer wrote:

>

On Monday, 25 August 2025 at 08:36:05 UTC, Nick Treleaven wrote:

>

On Monday, 25 August 2025 at 00:42:33 UTC, Steven Schveighoffer wrote:

>

Still, the op code compiling is a bug as the return value is not an rvalue.

-Steve

Who should report this bug to the D ticketing system?
This is above my pay grade now.

As Steven said, this is https://github.com/dlang/dmd/issues/19893. Someone could add an additional example.

1 2
Next ›   Last »