DLang BetterC dynamic arrays

dtoadq dtoadq at gmail.com
Mon Dec 24 22:07:21 UTC 2018


Ah, of course I find the solution immediately after I post. At 
least it seems to work fine;

```
struct Array(T) {
   T[] foo;

   this ( size_t size ) {
     T* data = cast(T*)malloc(size);
     foo = data[0..size];
   }
}
```


:-)


More information about the Digitalmars-d-learn mailing list