Simple template function to accept two parameters
#include <iostream>
using namespace std;
template <class type1, class type2>
void myFunction(type1 x, type2 y)
{
cout << x << ' ' << y << endl;
}
int main()
{
myFunction(10, "hi");
myFunction(0.23, 10L);
return 0;
}
Related examples in the same category