Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- void foo(int i)
- {
- std::cout << i << std::endl;
- };
- template<typename T, typename... Types>
- void fold_f(T arg, Types... args)
- {
- foo(arg);
- if constexpr (sizeof...(args) > 0)
- fold_f(args...);
- }
- int main()
- {
- fold_f(1, 2, 7);
- }
Advertisement
Add Comment
Please, Sign In to add comment