An exegesis of Walter's reference counted slice

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Tue Feb 24 14:11:36 PST 2015


On 2/24/15 1:55 PM, "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm at gmx.net>" 
wrote:
> On Tuesday, 24 February 2015 at 19:40:35 UTC, Andrei Alexandrescu wrote:
>> So: does DIP25 allow safe slices? Looks that way
>
> I believe it does, but at the cost of forced reference counting. As I
> pointed out, the `ref` solution

What is the ref solution?

> is not applicable to slices, therefore
> it needs to return an RCArray. This in turn forces an inc/dec whenever
> it is sliced or copied, and - maybe worse - it requires all consumers to
> support RCArray (or whatever other idiosyncratic RC implementation users
> come up with).

It seems to me it's time to have a UniqueArray proof of concept.


Andrei


More information about the Digitalmars-d mailing list