#include <iostream>
#include <string>
template <typename R>
R f(int a, int b);
template <>
int f<int>(int a, int b)
{
return a + b;
}
template <>
std::string f<std::string>(int, int)
{
return "surprise";
}
template <typename T>
void g(int a, int b, T& res)
{
res = f<T>(a, b);
}
int main()
{
int x;
std::string y;
g(1, 2, x);
g(1, 2, y);
std::cout << "x = " << x << ", y = " << y << std::endl;
}