how to use templates in c++ code example
Example 1: c++ template function
template <class T>
void swap(T & lhs, T & rhs)
{
T tmp = lhs;
lhs = rhs;
rhs = tmp;
}
Example 2: how to create a c++ templeate
template <class myType>
myType GetMax (myType a, myType b) {
return (a>b?a:b);
}
Example 3: c++ template
#include <iostream>
#include <string>
using namespace std;
int main() {
}