template class Adder { public: void set(T); T get(); T add(T); private: T val; }; template void Adder::set(T new_val) { val = new_val; } template T Adder::get() { return val; } template T Adder::add(T new_val) { val += new_val; return val; }