Check out example codes for "how to create a c++ templeate". It will help you in understanding the concepts better.

Code Example 1

template <class myType>
myType GetMax (myType a, myType b) {
 return (a>b?a:b);
}

Learn ReactJs, React Native from akashmittal.com