[Dlang-study] [lifetime] Few root decisions to take on RC classes

Timon Gehr timon.gehr at gmx.ch
Fri Oct 30 18:29:01 PDT 2015


On 10/30/2015 10:44 PM, deadal nix wrote:
> I don't think the case for baking @rc into the language has been made at
> this point. Providing guarantee about escaping is necessary and
> sufficient to build RC. Providing more needs to be justified. Right now,
> the only reason I've seen for this is optimization, but intrinsics are
> largely sufficient for this, and don't even need to be standardized.
>

Providing guarantees about escaping is not necessary except for 
optimizations. The reason for baking @rc into the language is that we 
want to be able to @safely escape the 'this' reference for 
reference-counted classes. I don't know if this is a strong enough case, 
but that does not prevent the DIP from being written. I think @rc does 
not conflict with type system features for managing lifetimes.


More information about the Dlang-study mailing list