std.container: fork in the road

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Wed Jun 17 08:03:41 PDT 2015


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


More information about the Digitalmars-d mailing list