Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string>
- template<typename T>
- T add(const T& arg)
- {
- return arg;
- }
- template<typename T, typename... Args>
- T add(const T& arg, const Args&... args)
- {
- return arg + add(args...);
- }
- int main()
- {
- add("a", "b", "c");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment