main.cpp:12:19: error: no matching function for call to 'max'
return elem > max(args...) ? elem : max(args...);
^~~
main.cpp:12:19: note: in instantiation of function template specialization 'max<int>' requested here
main.cpp:12:19: note: in instantiation of function template specialization 'max<double, int>' requested here
main.cpp:12:19: note: in instantiation of function template specialization 'max<int, double, int>' requested here
main.cpp:12:19: note: in instantiation of function template specialization 'max<int, int, double, int>' requested here
main.cpp:12:19: note: in instantiation of function template specialization 'max<double, int, int, double, int>' requested here
main.cpp:17:17: note: in instantiation of function template specialization 'max<double, double, int, int, double, int>' requested here
std::cout << max(7.5, 4.4, 8, 10, 3.5, 5);
^
main.cpp:4:3: note: candidate function template not viable: requires 2 arguments, but 0 were provided
T max(T first, T second)
^
main.cpp:10:3: note: candidate function template not viable: requires at least argument 'elem', but no arguments were provided
T max(T elem, Args... args)
^
1 error generated.
|