March 01
On Monday, 20 January 2025 at 23:11:46 UTC, Walter Bright wrote:
> On 1/20/2025 2:07 AM, Juraj wrote:
>> We now have local `ref`, and that makes this syntax a cognitive burden.
>
> Think of `cast(ref int)f` as "refer to `f` as if it were an `int`" and it will make perfect sense.

Why not `cast(*ref int)f`?
March 03
On Saturday, 1 March 2025 at 04:21:07 UTC, Elias Batek (0xEAB) wrote:
> On Monday, 20 January 2025 at 23:11:46 UTC, Walter Bright wrote:
>> On 1/20/2025 2:07 AM, Juraj wrote:
>>> We now have local `ref`, and that makes this syntax a cognitive burden.
>>
>> Think of `cast(ref int)f` as "refer to `f` as if it were an `int`" and it will make perfect sense.
>
> Why not `cast(*ref int)f`?

What does the * signify there? f is not a pointer.
March 04
On Monday, 3 March 2025 at 09:37:57 UTC, FeepingCreature wrote:
> What does the * signify there? f is not a pointer.

That the result is of the expression is not a `ref` either.

March 10

On Tuesday, 25 February 2025 at 12:46:53 UTC, Dukc wrote:

>

If anything, we want a library helper function like Paul suggested, but I'm slightly reserved even about that. When doing reinterpret casts, it's extremely important to understand exactly how the cast works. Any abstraction over that always tends to more or less hide it.

Looks like an abstraction got added:
https://dlang.org/phobos-prerelease/std_conv.html#bitCast
https://github.com/dlang/phobos/pull/10651

1 2 3 4
Next ›   Last »