#include "Set.h" template int Set::findLoc( const Object & x ) const { for( int i = 0; i < items.size( ); i++ ) if( items[ i ] == x ) return i; return NOT_FOUND; } template Cref Set::find( const Object & x ) const { int loc = findLoc( x ); if( loc == NOT_FOUND ) return Cref( ); else return Cref( items[ loc ] ); } template void Set::insert( const Object & x ) { items.push_back( x ); } template void Set::remove( const Object & x ) { int loc = findLoc( x ); if( loc == NOT_FOUND ) throw IllegalRemoveException( ); items[ loc ] = items.back( ); items.pop_back( ); } template bool Set::isEmpty( ) const { return items.size( ) == 0; } template void Set::makeEmpty( ) { items.resize( 0 ); }