D Language 2.0

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Jan 21 20:36:48 PST 2010


dsimcha wrote:
> == Quote from Andrei Alexandrescu (SeeWebsiteForEmail at erdani.org)'s article
>> Well if we get into details we'll figure that things must be quite
>> different for different memory management models. For example Object in
>> ref-counted mode is not a class anymore, it's a struct. So now there's
>> going to be two parts in an app: those in which Object is a class, and
>> those in which Object is a struct. Reconciling those would be a tall order.
>> Andrei
> 
> ????? Isn't the **whole point** of Object to be the root of the **class**
> hierarchy?????

It is. Object will be a wrapper refcounted struct that will contain a 
reference to a cloaked class object. The compiler will ensure that all 
accesses to the class object will be through the struct. The this(this) 
and the destructor of the struct will take care of incrementing and 
decrementing the intrusive reference counter embedded inside the class.


Andrei



More information about the Digitalmars-d mailing list