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

Andrei Alexandrescu andrei at erdani.com
Mon Nov 2 07:35:01 PST 2015


On 11/02/2015 10:31 AM, Martin Nowak wrote:
> On Friday, 30 October 2015 at 21:31:56 UTC, Andrei Alexandrescu wrote:
>> * @rc classes shall not be single-rooted. Rationale: there is
>> no strong advantage in it and it would force all @rc classes to
>> embed a vptr. This has been already discussed and largely
>> agreed upon in this group.
>
> I this really such a good idea to it simply b/c it's possible?
> It would kind of add a third species to struct/class, implying lots of
> work (compiler changes, debuggers, typeinfo...).
> And unless you want to break typeid(baseclass) which currently returns
> the dynamic type you wouldn't even safe the pointer.

Fine by me. Walter's and my thinking was we want to allow minimal 
overhead refcounting if possible. I'd say we can have a vptr in the 
implementation but should be careful about requiring it by design. -- Andrei


More information about the Dlang-study mailing list