On 19 September 2013 02:14, Andrej Mitrovic <andrej.mitrovich@gmail.com> wrote:On 9/18/13, Manu <turkeyman@gmail.com> wrote:This is just a current bug that will be fixed. As a workaround you can use this:
> And in D:
>
> struct Thing;
> extern (C) Thing* MakeThing();
>
> The question is, does this suck?
> D currently can't allocate an array of Thing*'s for some weird reason.
struct Thing
{
@disable this();
@disable this(this);
}
This will ensure "Thing" will never be copied by value, and you can
only use it with a pointer.
But since I'm always dealing with a pointer rather than a real type, I can't implement logic to inc/dec the ref-count on assignment. And how do I handle destruction/garbage collection?