Opaque handles...

Andrej Mitrovic andrej.mitrovich at gmail.com
Wed Sep 18 09:14:41 PDT 2013


On 9/18/13, Manu <turkeyman at gmail.com> wrote:
> 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.

This is just a current bug that will be fixed. As a workaround you can use this:

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.


More information about the Digitalmars-d mailing list