title: Overloading the assignment operator C++
body: <p>A homework assignment calls for the overloading of the consignment operator for a Heap class that is used to store pointers to queues at every node in an attempt to emulate a Emergency room priority queue. </p>
  
  <p>So far here is the code I've come up with:</p>
  
  <pre><code>    template &lt;typename T&gt;
      Heap&lt;T&gt;&amp; Heap&lt;T&gt;::operator=(const Heap&lt;T&gt; &amp; rhs)
      {
          //check for self-assignment
          if(this != &amp;rhs)
          {
              //delete memory
              for(int i = 0; i &lt; MAX_HEAP; i++)
              {
                  //delete queue at position i, set pointer to NULL
                  delete items[i];
                  items[i] = NULL;
              }//end for
              delete * items;
  
              //create new memory to hold copy of rhs
  
                          //error occurs here
              items = new queue&lt;T&gt; *[MAX_HEAP] ;
  
              for(int i = 0; i &lt; MAX_HEAP; i++)
                  items[i] = rhs.items[i];
  
              //assigns new stuff to this heap
              size = rhs.size;
              nodes = rhs.nodes;
  
          }//end if
          return *this;
      }//end =
  </code></pre>
  
  <p>items is declared in the header file as such:</p>
  
  <pre><code>    queue&lt;T&gt;* items[MAX_HEAP];
  </code></pre>
  
  <p>and is an instance of the standard library queue.</p>
  
  <p>I am not quite sure if I am using the proper syntax for creating a new dynamic array of queue pointers.</p>
  
  <p>I am getting an error that says:</p>
  
  <pre><code>    error C2440: '=' : cannot convert from 'std::queue&lt;_Ty&gt; **' to 'std::queue&lt;_Ty&gt; *[50]'
  </code></pre>
  
  <p>Any ideas as to what might cause it and how I can solve it?</p>