Code:
#include <iostream> 
#include <fstream> //allow writing to file instead of cout 
#include <cstring>
using namespace std;
#include "date.h" 
#include "person.h" 
#include "student.h" 
#include "Employee.h" 
#include "setT.h"

void main() {

ofstream file ("test_output.txt"); //file for  test results

file << "Program Output" << "\n"; //write title for test 
 

Person *p1 = new Person("Lou", "[email protected]", 20, 6, 1960);

Set<Person> s,s2,s3; 
Set<int> setints; 
Set<Date> dates; 




s.add(*p1); 

if (p1 != &(s.someElement())) 
 cout << "OBJECTS ARE NOT THE SAME\n"; //should not happen

 
s.add(*p1); //attempt to add a duplicate


s.add(*(new Person("Frank", "[email protected]", 20, 3, 1967))); 
s.add(*(new Person("Dave", "[email protected]", 21, 12, 1961)));


s.add(*(new Student("Eric", "[email protected]", Date(25, 4, 1958), "Carleton", 12345 ))); 
s.add(*(new Student("Mary", "[email protected]", Date(25, 4, 1955), "Carleton", 22234 ))); 
s.add(*(new Employee("John", "johnchat.ca", Date(12, 12, 1970), "Nortel", 99912 )));

int a = 5;
int b = 12;
int c = 12;
int d = 42;

setints.add(a).add(b).add(c).add(d).add(a); //note attempt to add a duplicate



file << setints; //print the ints

//file << "Printing the Set<int> \n"; //write comment to output file 
//file << setints; //print the ints to file

//print the names using the iterator.

for (s.reset(); s.hasMore(); s.advance() ) 
      cout << s.element().getName() << "  ";

//add some more people 
s.add(*(new Person("Alan", "[email protected]", 20, 3, 1967))); 
s.add(*(new Person("Eric", "[email protected]", 25, 4, 1958))); 
s.add(*(new Person("Bruce", "[email protected]", 25, 4, 1955))); 
 

//print out the three sets 
//file << s << "\n" << s2 << "\n" << s3 << "\n";

//Delete all the heap objects (they should all be in set s and dates 
cout << endl;
for (s.reset(); s.hasMore(); s.advance() ) 
{
	cout << "Deleting " << (s.element()) << endl;
	delete &(s.element());

}

for (dates.reset(); dates.hasMore(); dates.advance() ) 
{
    delete &(dates.element());
	cout << "test2\n";
}
file.close(); //close output file 
cin.get();

} //end main
I've had to comment out anything that has to do with file << in my assignment. I get an error saying:

binary '<<' : no operator found which takes a right-hand operand of type 'Set<T>' (or there is no acceptable conversion).

Can anybody tell me what's wrong with this...here is my set class

Code:
template <class T> 
class Set { 
public: 
	Set(int initial_size = 4):index(0),numberOfElements(0)
{
capacity = initial_size;
elements = new T*[capacity];
for (int i = 0; i < capacity; i++) elements[i] = NULL;
} 
Set(const Set<T> & s)
{
capacity = s.capacity;
elements = new T*[capacity];
for (int = 0; i<capacity; i++)
	elements[i] = s.elements[i];
}
~Set(void){delete [] elements;} //destructor 
Set<T> & operator=(const Set<T> & s)
{
	if (&s != this) {
capacity = s.capacity;
elements = new T*[capacity];
for (int = 0; i<capacity; i++)
	elements[i] = s.elements[i];
	} return *this;
}
Set<T> & add(T & element)
{
	if ((index == capacity)) 
	 {
		 std::cout << endl << "Container is growing." << endl << endl;
		 T ** temp = elements;
		 elements = new T*[capacity*2];
		 for(int i=0; i<index; i++) elements[i] = temp[i]; 
         capacity *= 2; 
         delete [] temp;
	 }

  	 for(int i = 0; i < capacity; i++)
	 if ((elements[i] != &element) && index < capacity)
	 {elements[index] = &element; index++; numberOfElements++; cout << element << " added" << endl; break;}
	 else {cout << endl << "Cannot add duplicate element." << endl << endl; break;}
	 return *this;	 
}  
Set<T> & remove(const T & element)
{
	 if(size() < capacity/4) {  //Shrinks the container when 1/4 full 
		 std::cout << "Container is shrinking.\n"; 
            elements = new t*[capacity/2]; 
            for(int i=0; i<index; i++) elements[i] = temp[i]; 
            capacity = capacity/2; 
            delete [] temp; 
	 }
} // remove object equal to element if it  exists 

T & someElement() const 
{
   index = 0;
   return  *elements[index++];
}
//answer some (any) element  of the set but don't remove it 
//Iterator Methods 

void reset() const {index = 0;}
bool hasMore() const {return index < numberOfElements;} 
void advance() const {index++;}
T & element()const {return *elements[index];}

int size()const {return numberOfElements;} //answer the number of elements in the set. 
void printOn(ostream & ostr){ostr << "hey";} //print the elements of the set

private: 
T ** elements;  //to store elements (like assignment #1) 
int numberOfElements; //number of elements in the set 
int capacity; //max. no of elements the set can current memory can hold
mutable int index; //private variable used for the iteration
};