A Refcounted Array Type

Namespace via Digitalmars-d digitalmars-d at puremagic.com
Tue Feb 24 02:11:01 PST 2015


On Tuesday, 24 February 2015 at 10:08:23 UTC, matovitch wrote:
> On Tuesday, 24 February 2015 at 09:44:13 UTC, Walter Bright 
> wrote:
>> On 2/24/2015 1:32 AM, Jonathan M Davis via Digitalmars-d wrote:
>>> The issue is that delete is considered @safe by the compiler,
>>
>> I thought more people would be interested in how to do a 
>> memory safe reference counted container.
>
> This is really interesting ! Thought as a beginner, I am 
> wondering why the counter need to be a pointer ?

That's why:
----
this(this)
{
     if (count)
         ++*count;
}
----


More information about the Digitalmars-d mailing list