Back to Multiple Choice Quiz
Template Instantiation Failure
C++ quiz · Question 58The following code fails to compile at the call site. Why?
#include <iostream>
using namespace std;
template <typename T>
void printSum(T a, T b) {
cout << a + b << "\n";
}
struct Point { int x, y; };
int main() {
printSum(Point{1,2}, Point{3,4});
}