11.8 — Function templates with multiple template types
In lesson , we wrote a function template to calculate the maximum of two values: #include <iostream> template <typename T> T max(T x, T y) { return (x < y) ? y : x; } int main() { std::cout << max(1, 2) << ‘\n’; // will instantiate max(int, int) std::cout …