Persistent list

Dicebot via Digitalmars-d digitalmars-d at puremagic.com
Tue Nov 17 05:38:35 PST 2015


On Tuesday, 17 November 2015 at 12:32:03 UTC, Timon Gehr wrote:
> On 11/17/2015 04:50 AM, Dicebot wrote:
>> ...
>> https://gist.github.com/mihails-strasuns-sociomantic/1d7529eef723b1132564
>
> Again, this idiom does not do anything:
>
> static assert(
>     !is(typeof(this) == immutable),
>     "PersistentList itself must be mutable for allocation / RC 
> purposes"
> );
>
> The condition is always true.

Acknowledged, I have simply copied it from original sample to 
show that intention os the same. It isn't as critical in my case 
though as the code simply won't compile as immutable (no const 
casts).

> Anyway, any design that does not allow e.g. nested lists is 
> inadequate IMO.

But here I have to disagree. There simply isn't anything generic 
in immutable containers with RC, each requires own tweaked 
solution. It all works nice with GC because all memory tracking 
becomes exclusively external - trying to ignore and hide that 
fact makes no sense to me.

Main use case for such containers is efficient thread sharing and 
that totally justifies specialized container (or even allocator) 
for each dataset.


More information about the Digitalmars-d mailing list