Passing a variadic function as argument
问题 Consider this working code: #include <iostream> #include <utility> #include <array> template <typename... Args> void foo (Args&&... args) { const auto v = {args...}; for (auto x : v) std::cout << x << ' '; std::cout << '\n'; } template <typename> struct Foo; template <std::size_t... Is> struct Foo<std::index_sequence<Is...>> { template <typename Container> static void execute (const Container& v) { foo(v[Is]...); } }; template <std::size_t N> void fooArray (const std::array<int, N>& a) { Foo