Click on main3.cpp to get source.
#include <iostream>
#include <iterator>
#include "prof3.h"
using namespace std;
ostream& operator<<(ostream& os, const PROF& professor)
{os << professor.lname << " " << professor.fname;
return os;
}
template< typename PROF_CONTAINER >
ostream& operator<< (ostream& os, const PROFLIST< PROF_CONTAINER >& L)
{ostream_iterator<PROF> out(os, "\n");
copy(L.begin(), L.end(), out);
return os;
}
template
class PROFLIST< set<PROF> >;
int main(int argc, char* argv[])
{PROF caviness("Caviness", "Bob", 'F', 100.0, 1, 4.5)
,kaltofen("Kaltofen", "Erich", 'L', 50.0, 1, 3.0)
,saunders("Saunders", "Benjamin",'D', 95.0, 2, 3.5)
;
PROFLIST< list<PROF> > L;
PROFLIST< set<PROF> > L2;
L.hire(caviness);
cout << L << endl;
L.hire(saunders); cout << L << endl;
L.hire(kaltofen); cout << L << endl;
L.fire("Kaltofen"); cout << L << endl;
L.fire("Caviness"); cout << L << endl;
L.fire("Pipes"); cout << L << endl;
cout << "--------" << endl;
L2.hire(kaltofen);cout << L2 << endl;
L2.hire(saunders);cout << L2 << endl;
L2.fire("Kaltofen"); cout << L2 << endl;
return 0;
}