Mega Code Archive
Categories
/
C++
/
Generic
Define template function for class type
#include
using namespace std; template
void myFunction(type1 x, type2 y) { cout << x << ' ' << y << '\n'; } int main() { myFunction(10, "hi"); myFunction(0.23, 10L); return 0; }