Re: Allocating Heap/GC Storage upon Default Construction of RC Containers

2016-09-22 Thread Andrei Alexandrescu via Digitalmars-d-learn
On 9/21/16 8:49 AM, Nordlöw wrote: Is there any way to make a default constructor of a struct container allocate/initialize an internal pointer? I need this in a container with RC behaviour similar to struct Container { this()// this is currently forbidden: { _rcStore = empl

Allocating Heap/GC Storage upon Default Construction of RC Containers

2016-09-21 Thread Nordlöw via Digitalmars-d-learn
Is there any way to make a default constructor of a struct container allocate/initialize an internal pointer? I need this in a container with RC behaviour similar to struct Container { this()// this is currently forbidden: { _rcStore = emplace(cast(RCStore*)malloc(RCStore.si