Battle-plan for CTFE

Martin Nowak via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Mon May 16 06:06:27 PDT 2016


On 05/16/2016 03:03 PM, Martin Nowak wrote:
>   ~this()
>   {
>     if (impl.onHeap && --impl.heap.refCount == 0)
>       heapAllocator.free(impl.heap);
>   }

Of course missing the increment for copies.

    this(this)
    {
      if (impl.onHeap)
        ++impl.heap.refCount;
    }



More information about the Digitalmars-d-announce mailing list