template
class Set 
{
public:
   void insert(const T& item);
   void remove(const T& item);
private:
   std::list rep;
}
template<         
          
I think in general you need both the typename/class T in the class declaration as well as function definitions because you can define full/partial template specifications for function definitions. Ie. you could specialize your remove function for ints, strings, whatever it happens to be. So in this case you're telling the compiler "This is the general template, for any type" then later you might define the same function specified for only integers.