Pass a function template to other function
问题 Suppose I have a function that does something on an arbitrary container type (C++11): template<class containerType> void bar( containerType& vec ) { for (auto i: vec) { std::cout << i << ", "; } std::cout << '\n'; } I can call this function from another function like this: void foo() { std::vector<int> vec = { 1, 2, 3 }; bar(vec); } Now suppose I have different functions just like bar, and I want to pass one of these functions to foo, then foo would look something like this: template<class