concurrency problem with pointers

Ali Çehreli acehreli at yahoo.com
Fri Jul 19 11:25:25 PDT 2013


On 07/19/2013 11:07 AM, evilrat wrote:

 > i don't think this is compiler bug, it's just how it works.

But what code needs toHash and others for the struct type even though we 
are just passing a pointer around?

 > yet this is
 > another thing one must remember when writing library - never use struct
 > predefenitions(or any other forward refs).
 > so concluding all of this, it is clear this is a derelict library bug,

I am not convinced yet. I think it is something that std.concurrency is 
doing (perhaps because it relies on Variant?). Otherwise there is no 
problem with what derelict does. The following code compiles:

struct S;

void myReceive(void delegate (S *) func)
{
     S * p;
     func(p);
}

void main()
{
     myReceive((S * p){});
}

Ali



More information about the Digitalmars-d-learn mailing list