Quiz · Templates · lesson 3 of 11
Quiz — argument deduction
What happens when you build and run this program?
#include <iostream>
template <typename T>
T max_of(T a, T b) {
return a > b ? a : b;
}
int main() {
int n = 1;
double x = 2.5;
std::cout << max_of(n, x);
}Subscribe to take the course
The course is free. Sign in with Telegram and subscribe to the channel to open every lesson.