← Back to Question List
C++ Quiz #121
When the Compiler Cannot Deduce T
T appears only in the return type of zero, and the function takes no arguments. Which call compiles?
📄 Code
1#include <iostream>23template <typename T>4T zero() {5 return T{};6}78int main() {9 double d = zero<double>();10 std::cout << d << "\n";11 return 0;12}