When I wrote a C++ code and compiled it by the clang++ compiler,
error: expected expression
template <typename T>
^
was represented.
Why did this error appeared and how do I fix it?
#include<iostream>
using namespace std;
int main() {
template <typename T>
T sum(T a, T b) {
return a+b;
}
cout <<"Sum = " << sum( 2.1, 7.9 ) << endl;
return 1;
}