title: Unable to use overloaded [] operator on an object using the this pointer
body: <p>I'm having issues with the overloaded + operator and the overloaded [] operator. The [] function works fine when used on the OrderedList right object but I cannot get it to return the correct value when used with the this pointer.</p>
  
  <p>The way the code works in main is something like:
      list3 = list1 + list2</p>
  
  <p>where list2 becomes 'right' in the parameter list, and I am trying to use the this pointer to get the value at the subscript for list1.</p>
  
  <p>The error I'm getting is "cannot convert OrderedList to double in assignment" but I am unsure why it is trying to assign an OrderedList?</p>
  
  <p>Any help much appreciated, thanks.</p>
  
  <pre><code>OrderedList OrderedList::operator+(OrderedList &amp;right)
  {
      int size1 = this -&gt; _size;
      int size2 = right.getSize();
      double x, y;
      y = right[size2];
      x = this[size1];
      OrderedList list3;
      return list3;
  }
  
  double OrderedList::operator[](int subscript) const // returns rvalue 
  {
      int x = OrderedList::_size;
      if (subscript &gt; x)
      {
          cout &lt;&lt; "Error: number is bigger than the size of the list" &lt;&lt; endl;
      }
      else
      {
          Node* temporary = OrderedList::getListHead();
          for (int counter = 1; counter &lt; subscript; counter++)
          {
              temporary = temporary -&gt; next;
          }
          double nodeValue = temporary -&gt; item;
          return nodeValue;
      }
  }
  </code></pre>