On Mon, Jul 26, 2010 at 19:11, dcoder <dco...@devnull.dev> wrote:

> == Quote from Rory Mcguire (rjmcgu...@gm_no_ail.com)'s article
> > Dmitry Olshansky wrote:
>


std.typecons.Tuple fields cannot be indexed like arrays, Andrei made a
mistake. To access field  #n, use ._n or .field[n]. There is no difference
between the two.

void writer() {
 for( ;; ) {
   auto msg = receiveOnly!(Tid, int)(); // msg is a Tuple!(Tid, int), msg._0
is a Tid, msg._1 is an int.
   writeln( "Secondary thread: ", msg._1);
   msg._0.send(thisTid);
 }
}

Also, in my case, the return; in writer must be commented out, or DMD
complains it cannot be reached.


Philippe

Reply via email to