You do not need any generics for that. The
+
operator is already overloaded for
string
and
int
:
int i = 0;
string str = "";
string result = i + str;
string ret = str + i;
That compiles;
i.ToString()
is called somewhere in the background when the values are added.