Multi patterend varadic templates in C++
问题 I don't think this is possible based on what I've read however I'm hoping someone here may know of some solution that would get this to work. I have a vector (maths) class for C++ template <typename T, size_t N> class vec; And want to create a varadic friend function apply to apply a function to these vectors element-wise i.e. template <typename F, typename ...Args> friend vec<typename std::result_of<pow(Args&&...)>::type, N> apply(F&& f, const vec<Args, N>&... args); which is valid (untested