175. Template

Question.15

A developer calls a template function without specifying the type:

template<typename T>
T max_val(T a, T b) { return (a > b) ? a : b; }

int result = max_val(10, 20);  // No <int> specified

How does the compiler know T is int?

Need Help? Refer to the Quick Guide below

Select Answer