First Draft: cast(ref T)... as shorthand for *cast(T*)&...

Andrea Fontana nospam at example.com
Tue Jan 21 10:22:56 UTC 2025


On Tuesday, 21 January 2025 at 03:43:02 UTC, Paul Backus wrote:
> On Monday, 20 January 2025 at 22:55:29 UTC, Walter Bright wrote:
>> On 1/19/2025 9:33 AM, Paul Backus wrote:
>>> Why not just add a simple `reinterpretCast!T` helper function 
>>> to Phobos or druntime?
>>
>> Great question.
>>
>> `reinterpretcast!T` is just ugly. I never liked it in C++. 
>> `cast(ref T)`, on the other hand, looks nice.
>
> Would you be open to using a helper function if it had a 
> shorter, less ugly name?

ptrCast!T


More information about the dip.development mailing list