Im working on a homework for a class and im not looking for someone to write the code for me but my professor wants us to write a template function and use his already existing code to call the function. the problem im having is his code(posted below) calls the function like this: add_one(x)(y). he also insists that his code has no errors so i dont really know how to write a template function that allows you to call it like this. can anyone tell me how to do this?
my professors code.
int main()
{
int x = 2;
int y = 3;
cout << x << " + " << y << " = " << add_one(x)(y) << endl;
string s = "Hello";
string t = "World";
cout << s << " + " << t << " = " << add_one(s)(t) << endl;
}