Two variation patterns for one function?

In C ++ 11, is it possible to have two variation patterns for one function?

If not, is there a trick to writing something like this:

template <class... Types, class... Args> void f(const std::tuple<Types...>& t, Args&&... args) 
+8
c ++ c ++ 11 templates variadic-functions variadic-templates
source share
1 answer

This is completely legal:

 #include <tuple> using namespace std; template <class... Types, class... Args> void f(const std::tuple<Types...>& t, Args&&... args) { // Whatever... } int main() { std::tuple<int, double, bool> t(42, 3.14, false); f(t, "hello", true, 42, 1.0); return 0; } 
+12
source share

All Articles