title: "No match for 'operator=' in", structs error C++
body: <p>When I compile under g++ I get the following errors:</p>
  <blockquote>
  <p>In function <code>'int search(int, int, int)'</code>:</p>
  <p>1584:error: no match for <code>'operator='</code> in <code>'* tt = &amp; core.&lt;anonymous union&gt;::tt[((hash_stack[ply] &gt;&gt; 16) &amp; 2047ul)]'</code></p>
  <p>1584:error: note: candidate is:</p>
  <p>118:note: <code>tt_type&amp; tt_type::operator=(const tt_type&amp;)</code></p>
  <p>118:note:   no known conversion for argument 1 from <code>'tt_type*'</code> to <code>'const tt_type&amp;'</code></p>
  </blockquote>
  <pre><code>static int search(int depth, int alpha, int beta) {
      int                             best_score = -INF;
      int                             best_move = 0;
      int                             score;
      struct move                     *moves;
      int                             incheck = 0;
      struct tt_type                  *tt;                              //LINE 1584
      int                             oldalpha = alpha;
      int                             oldbeta = beta;
      int                             i, count=0;
  
      nodes++;
  
      /* test for draw by repetition */
      hash_stack[ply] = compute_hash();
      for (i=ply-4; i&gt;=board[LAST]; i-=2) {
          if (hash_stack[i] == hash_stack[ply]) count++;
          if (count&gt;=2) return 0;
      }
  
      /*
       *  check transposition table
       */
      *tt = &amp;TTABLE[ ((hash_stack[ply]&gt;&gt;16) &amp; (CORE-1)) ];
      if (tt-&gt;hash == (hash_stack[ply] &amp; 0xffffU)) {
          if (tt-&gt;depth &gt;= depth) {
              if (tt-&gt;flag &gt;= 0) alpha = MAX(alpha, tt-&gt;score);
              if (tt-&gt;flag &lt;= 0) beta = MIN(beta,  tt-&gt;score);
              if (alpha &gt;= beta) return tt-&gt;score;
          }
          best_move = tt-&gt;move &amp; 07777;
      }
  </code></pre>
  <p>Where I have previously defined</p>
  <pre><code>struct tt_type {                                                       //LINE 118
      unsigned short hash;    /* - Identifies position */
      short move;             /* - Best recorded move */
      short score;            /* - Score */
      char flag;              /* - How to interpret score */
      char depth;             /* - Remaining search depth */
  };
  </code></pre>