#ifndef _SET_H_ #define _SET_H_ #include #include using namespace std; template class Set { public: bool contains( const Object & x ) const; bool isEmpty( ) const; int getSize( ) const; void print( ostream & out = cout ) const; void makeEmpty( ); void insert( const Object & x ); void remove( const Object & x ); Set setUnion( const Set & rhs ) const; Set intersect( const Set & rhs ) const; private: vector items; enum { NOT_FOUND = -1 }; int findPos( const Object & x ) const; }; template ostream & operator<< ( ostream & out, const Set & x ) { x.print( out ); return out; } #endif