2 days ago Re: First Draft: cast(ref T)... as shorthand for *cast(T*)&... | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | 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`?
|
10 hours ago Re: First Draft: cast(ref T)... as shorthand for *cast(T*)&... | ||||
---|---|---|---|---|
| ||||
Posted in reply to Elias Batek (0xEAB) | 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.
|
Copyright © 1999-2021 by the D Language Foundation