const as default for variables

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Tue Mar 17 15:53:19 PDT 2015


On Tuesday, 17 March 2015 at 22:25:30 UTC, Zach the Mystic wrote:
> The real devil against safe reference counting is in the 
> assignment operators, when they do destructive moves. I think 
> those have to be the focus of any effort here.
>
> I'm trying to imagine a parameter attribute `@destroy`, for 
> example, indicating that its reference may get destroyed. Not 
> sure if it will work, or even help, but it's a start.

That is the wrong approach. This is a know problem and there is a 
known solution: ownership. If we are going to add something in 
the language to handle it, then it has to be ownership.


More information about the Digitalmars-d mailing list