You are viewing a single comment's thread. Return to all comments →
template <class T> class AddElements { T element; public: AddElements (T arg) {element=arg;} T add (T x) {return x+element;} }; template <> class AddElements <string> { string element; public: AddElements (string arg) {element=arg;} string concatenate (string arg) { string s = element+arg; return s; } };
Seems like cookies are disabled on this browser, please enable them to open this website
C++ Class Templates
You are viewing a single comment's thread. Return to all comments →