>From the concurrency chapter, TDPL states that tuple fields are accessed
with the [] operator, as in:

***void* writer() {
   *for* (;;) {
      *auto* msg = receiveOnly!(Tid, *int*)();
      writeln("Secondary thread: ", msg[1]);

      msg[0].send(thisTid);
   }
}


However, for me this code returns compile time errors like this:
Error: no [] operator overload for type Tuple!(Tid,uint)

If I add .field to the tuple access, it compiles fine:

***void* writer() {
   *for* (;;) {
      *auto* msg = receiveOnly!(Tid, *int*)();

      writeln("Secondary thread: ", msg.field[1]);
      msg.field[0].send(thisTid);
   }
}


What is the explanation?
Thanks,
-steve

Reply via email to