I have a function with 2 overloaded arguments
template<typename... Args>
void f(Args&&...) {
cout << "Args..." << endl;
}
void f(...) {
cout << "..." << endl;
}
Can someone explain how does the lookup work? In my opinion, purpose of each function is the same (except first one is c++ style and second is c style). When I call function with arguments despite their types f(5, "hello") or f(5, 10) it is always variadic template (first overload), but when I call function without arguments f() it is always variadic function (second overload). Is there a strong rule which compiler follows to choose the right function and what is the logic behind it?