draft proposal for ref counting in D

Walter Bright newshound2 at digitalmars.com
Wed Oct 9 19:20:23 PDT 2013


Michel Fortin wrote:

Le 28-juin-2013 à 17:03, Rainer Schuetze <r.sagitario at gmx.de> a écrit :

 > Any parameter of type C is also lowered to shared_ptr!C.

class C {}

People still constantly forget that C used as a type represents a *reference* to 
an object of class C, not the object itself. If you replace type C with 
shared_ptr!C, you must then replace it with shared_ptr!(shared_ptr!C) and so on; 
there's no end to it.

Also, I strongly doubt the compiler will be able to elide redundant calls to 
retain/release made within shared_ptr!C while still respecting normal struct 
semantics.



More information about the Digitalmars-d mailing list