Skip to content
Quiz · Templates · lesson 3 of 11

Quiz — argument deduction

What happens when you build and run this program?

C++
#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);
}