<font style="font-family: georgia,serif;" face="courier new,monospace"><font size="2">From the concurrency chapter, TDPL states that tuple fields are accessed with the [] operator, as in:<br></font></font><pre style="font-family: courier new,monospace;">

<font size="4"><strong></strong><font size="2"><strong>void</strong> writer() {<br>   <strong>for</strong> (;;) {<br>      <strong>auto</strong> msg = receiveOnly!(Tid, <strong>int</strong>)();<br>      writeln(&quot;Secondary thread: &quot;, msg[1]);<br>

      msg[0].send(thisTid);<br>   }<br>}</font></font></pre><font style="font-family: courier new,monospace;" face="courier new,monospace"><br style="font-family: georgia,serif;"><span style="font-family: georgia,serif;">However, for me this code returns compile time errors like this:</span><br style="font-family: georgia,serif;">

<span style="font-family: georgia,serif;">Error: no [] operator overload for type Tuple!(Tid,uint)</span><br style="font-family: georgia,serif;"><br style="font-family: georgia,serif;"><span style="font-family: georgia,serif;">If I add .field to the tuple access, it compiles fine:</span><br>

<br></font><pre style="font-family: courier new,monospace;"><font size="4"><strong></strong><font size="2"><strong>void</strong> writer() {<br>   <strong>for</strong> (;;) {<br>      <strong>auto</strong> msg = receiveOnly!(Tid, <strong>int</strong>)();<br>

      writeln(&quot;Secondary thread: &quot;, msg.field[1]);<br>      msg.field[0].send(thisTid);<br>   }<br>}</font></font></pre>
<br style="font-family: courier new,monospace;"><span style="font-family: georgia,serif;">What is the explanation?</span><br style="font-family: georgia,serif;"><span style="font-family: georgia,serif;">Thanks,</span><br style="font-family: georgia,serif;">

<span style="font-family: georgia,serif;">-steve</span><br>