Object Specific ArrayList C++ Issue
<p>I currently have a Person class, and have created a PersonList class that extends List, specifically for objects of type Person. When I instantiate a new PersonList I get one error that stops the entire build from happening successfully:</p>

<p>error C2678: binary '==' : no operator found which takes a left-hand operand of type 'Person' (or there is no acceptable conversion)    c:\program files\microsoft visual studio 11.0\vc\include\xutility   3186    1   ConsoleApplication3</p>

<p>Here is the PersonList class:</p>

<pre><code>#pragma once
#include&lt;iostream&gt;
#include&lt;sstream&gt;
#include&lt;string&gt;
#include&lt;algorithm&gt;
#include "linearList.h"
#include "myExceptions.h"
#include "changeLength1D.h"
#include &lt;Person.h&gt;

using namespace std;

template&lt;class Person&gt;
class PersonList: public linearList&lt;Person&gt; 
{
public:
PersonList(int initialCapacity = 10);
PersonList(const PersonList&lt;Person&gt;&amp;);
~PersonList() {delete [] element;}

bool empty() const {return listSize == 0;}
  int size() const {return listSize;}
  Person&amp; get(int theIndex) const;
  int indexOf(const Person&amp; theElement) const;
  void erase(int theIndex);
  void insert(int theIndex, const Person&amp; theElement);
  void output(ostream&amp; out) const;

  // additional method
  int capacity() const {return arrayLength;}

  protected:
  void checkIndex(int theIndex) const;
        // throw illegalIndex if theIndex invalid
  Person* element;            // 1D array to hold list elements
  int arrayLength;       // capacity of the 1D array
  int listSize;          // number of elements in list
  };

template&lt;class Person&gt;
PersonList&lt;Person&gt;::PersonList(int initialCapacity)
{// Constructor.
if (initialCapacity &lt; 1)
{ostringstream s;
  s &lt;&lt; "Initial capacity = " &lt;&lt; initialCapacity &lt;&lt; " Must be &gt; 0";
 throw illegalParameterValue(s.str());
}
arrayLength = initialCapacity;
element = new Person[arrayLength];
listSize = 0;
 }

template&lt;class Person&gt;
PersonList&lt;Person&gt;::PersonList(const PersonList&lt;Person&gt;&amp; theList)
{// Copy constructor.
arrayLength = theList.arrayLength;
listSize = theList.listSize;
element = new Person[arrayLength];
copy(theList.element, theList.element + listSize, element);
}


template&lt;class Person&gt;
void PersonList&lt;Person&gt;::checkIndex(int theIndex) const
{// Verify that theIndex is between 0 and listSize - 1.
if (theIndex &lt; 0 || theIndex &gt;= listSize)
{ostringstream s;
s &lt;&lt; "index = " &lt;&lt; theIndex &lt;&lt; " size = " &lt;&lt; listSize;
throw illegalIndex(s.str());
}

}

template&lt;class Person&gt;
Person&amp; PersonList&lt;Person&gt;::get(int theIndex) const
{// Return element whose index is theIndex.
 // Throw illegalIndex exception if no such element.
 checkIndex(theIndex);
 return element[theIndex];
 }   

 template&lt;class Person&gt;
int PersonList&lt;Person&gt;::indexOf(const Person&amp; theElement) const
{// Return index of first occurrence of theElement.
 //  Return -1 if theElement not in list.

  // search for theElement
  int theIndex = (int) (find(element, element + listSize, theElement)
                     - element);

   // check if theElement was found
  if (theIndex == listSize)
   // not found
    return -1;
    else return theIndex;
    }

template&lt;class Person&gt;
void PersonList&lt;Person&gt;::erase(int theIndex)
{// Delete the element whose index is theIndex.
 // Throw illegalIndex exception if no such element.
 checkIndex(theIndex);

 // valid index, shift elements with higher index
 copy(element + theIndex + 1, element + listSize,
                            element + theIndex);

   element[--listSize].~Person(); // invoke destructor
  }



template&lt;class Person&gt;
void PersonList&lt;Person&gt;::insert(int theIndex, const Person&amp; theElement)
{// Insert theElement so that its index is theIndex.
if (theIndex &lt; 0 || theIndex &gt; listSize)
{// invalid index
  ostringstream s;
  s &lt;&lt; "index = " &lt;&lt; theIndex &lt;&lt; " size = " &lt;&lt; listSize;
  throw illegalIndex(s.str());
}

// valid index, make sure we have space
 if (listSize == arrayLength)
  {// no space, double capacity
     changeLength1D(element, arrayLength, 2 * arrayLength);
     arrayLength *= 2;
  }

  // shift elements right one position
   copy_backward(element + theIndex, element + listSize,
             element + listSize + 1);

    element[theIndex] = theElement;

     listSize++;
    }

template&lt;class Person&gt;
void PersonList&lt;Person&gt;::output(ostream&amp; out) const
{// Put the list into the stream out.
 copy(element, element + listSize, ostream_iterator&lt;Person&gt;(cout, "  "));
 }

// overload &lt;&lt;
template &lt;class Person&gt;
ostream&amp; operator&lt;&lt;(ostream&amp; out, const PersonList&lt;Person&gt;&amp; x)
 {x.output(out); return out;}
</code></pre>

<p>The Person Class:</p>

<pre><code>#pragma once
#include &lt;string&gt;

using namespace std;


class Person
{
public:
Person(string firstName, string lastName, string birthday, string hometown);
Person(void);
~Person(void);
string name;
string birthday;
string hometown;
};
</code></pre>

<p>The same thing happens in an arrayList class I tried using earlier. Is there a way to get it so I can simply store person objects in an ArrayList type structure?</p>
