std.container: fork in the road

rsw0x via Digitalmars-d digitalmars-d at puremagic.com
Wed Jun 17 08:17:16 PDT 2015


On Wednesday, 17 June 2015 at 15:03:40 UTC, Andrei Alexandrescu 
wrote:
> On 6/17/15 2:59 AM, "Marc =?UTF-8?B?U2Now7x0eiI=?= 
> <schuetzm at gmx.net>" wrote:
>>
>> I think this decision should be left to the end-user. A 
>> container that
>> supports only RC is just as bad as one that supports only GC. 
>> Instead,
>> use SList!T or SList!(Unique!T) or SList(RefCounted!T) as 
>> appropriate.
>>
>> All internal metadata, on the other hand, should be treated as 
>> owned by
>> the container. Calling clear() or removing individual elements 
>> needs to
>> destroy the associated meta data, which in turn will correctly 
>> call the
>> payload's (e.g. RefCounted!T or Unique!T) destructor if it has 
>> one.
>
> Yah, management strategy refers to the metadata. -- Andrei

Do you plan on std.collections being usable both with and without 
the GC?


More information about the Digitalmars-d mailing list