C++ pattern matching is coming

IGotD- nise at nise.com
Mon Oct 24 21:02:55 UTC 2022


On Monday, 24 October 2022 at 20:38:59 UTC, Walter Bright wrote:
>
> It seems you're suggesting attaching this behavior to the 
> pointer, rather than the function. That means multiple pointer 
> types.
>

I think what he means are movable types. Movable types are moved 
by default and if a copy is needed there is an explicit method to 
do so. In the case of D that could be newPointer = 
oldPointer.dup. dup implementation is dependent on type. In the 
case of raw pointers like D has today, dup wouldn't do much other 
than assigning the pointer and perhaps some compiler intrinsic 
for the life time system.


More information about the Digitalmars-d mailing list