You are viewing a single comment's thread. Return to all comments →
Sharing my solution here :)
template <class T> class AddElements { public: T element; AddElements(T i) {element = i;} T add(T i) {return element+i;} private: }; template <> class AddElements <string> { public: string element; AddElements(string i) {element = i;} string concatenate(string element2) {return element+element2;} private: };
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 →
Sharing my solution here :)