You are viewing a single comment's thread. Return to all comments →
Move to C++20 and force std::cin with
ios_base::sync_with_stdio(false); cin.tie(NULL); template <class T> class AddElements { T data; public: AddElements(T value) : data(value) {} T add(T a) { data += a; return data; } }; template <> class AddElements<string> { public: string s; AddElements(const string& value): s(value) {} AddElements(string&& value): s(std::move(value)) {} string concatenate(const string& a) { return s.append(a); } };
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 →
Move to C++20 and force std::cin with