Question 1
Topic: Templates
Skill tested: Applies function-template argument deduction and overload resolution to generic interfaces.
A telemetry library has a generic formatting function that accepts a value and returns a string. Most callers should use a template so that the function supports new numeric types without adding overloads. For `format(T value)`, the implementation streams `value` into an `std::ostringstream`. A caller passes a string literal, and the current template instantiation fails because the stream expression is ambiguous for the array type. The team wants to preserve the generic function and avoid changing all call sites. Which change best addresses the issue while keeping the function reusable?
A non-template overload for `const char*` handles string literals through the normal array-to-pointer conversion and can delegate using an `std::string`, avoiding the problematic array instantiation while retaining generic support for other types. Changing the parameter to `T&` can deduce an array reference rather than causing the desired conversion. `typename` and `class` are equivalent in this template-parameter context, and converting the interface to a class template does not solve the deduction or streaming issue.