Objects on message queues of spawned processes

Ali Çehreli acehreli at yahoo.com
Wed Apr 18 15:04:02 PDT 2012


On 04/18/2012 11:18 AM, Russel Winder wrote:

 > Using  DMD 2.059 I get the error message:
 >
 > singleBarber_d2_spawn.d(35): Error: template std.concurrency.receive 
does not match any function template declaration
 > 
/home/users/russel/lib.Linux.x86_64/DMD2/bin64/../../src/phobos/std/concurrency.d(530): 
Error: template std.concurrency.receive(T...) cannot deduce template 
function from argument types !()(void delegate(Customer customer) 
@system,void,void)

I have hit this problem earlier. Here is a reduced code:

import std.concurrency;

struct S
{}

void main()
{
     receive((S) {});  // <-- compilation error with 2.059
}

The workaround is to name the parameter:

     receive((S s) {});

Ali



More information about the Digitalmars-d mailing list